claude refactorings, flutter best practices, platform dependent changes, general cleanup

This commit is contained in:
2026-05-06 11:58:50 +02:00
parent 4b1d4379a0
commit 4e1272aba9
281 changed files with 1948 additions and 1041 deletions
@@ -0,0 +1,27 @@
import '../../../../../api/marianumcloud/talk/chat/get_chat_cache.dart';
import '../../../../../api/marianumcloud/talk/chat/get_chat_response.dart';
class ChatDataProvider {
Future<GetChatResponse> getChat({
required String token,
void Function(GetChatResponse data)? onUpdate,
void Function(Object)? onError,
}) async {
GetChatResponse? latest;
Object? capturedError;
final cache = GetChatCache(
chatToken: token,
onUpdate: (data) {
latest = data;
onUpdate?.call(data);
},
onError: (e) {
capturedError = e;
onError?.call(e);
},
);
await cache.ready;
if (latest != null) return latest!;
throw capturedError ?? Exception('No data and no error from getChat');
}
}