refactor: migrate to flutter_math_fork and markdown_widget for enhanced markdown capabilities

- Replaced flutter_markdown_plus with flutter_math_fork to improve mathematical rendering within markdown content.
- Integrated markdown_widget for better markdown processing and rendering, enhancing overall user experience.
- Updated the markdown configuration to utilize the new packages, ensuring maintainability and adaptability of markdown features.
- Refactored the streaming markdown widget to accommodate the new markdown processing logic, improving code clarity and performance.
This commit is contained in:
cogwheel0
2025-10-04 13:37:47 +05:30
parent 399b44bc74
commit e04b43949b
9 changed files with 434 additions and 131 deletions

View File

@@ -519,18 +519,25 @@ final attachmentUploadQueueProvider = Provider<AttachmentUploadQueue?>((ref) {
// Auth providers
// Auth token integration with API service - using unified auth system
final apiTokenUpdaterProvider = Provider<void>((ref) {
// Listen to unified auth token changes and update API service
void syncToken(ApiService? api, String? token) {
if (api == null) return;
api.updateAuthToken(token != null && token.isNotEmpty ? token : null);
final length = token?.length ?? 0;
DebugLogger.auth(
'token-updated',
scope: 'auth/api',
data: {'length': length},
);
}
syncToken(ref.read(apiServiceProvider), ref.read(authTokenProvider3));
ref.listen<ApiService?>(apiServiceProvider, (previous, next) {
syncToken(next, ref.read(authTokenProvider3));
});
ref.listen<String?>(authTokenProvider3, (previous, next) {
final api = ref.read(apiServiceProvider);
if (api != null) {
api.updateAuthToken(next);
final length = next?.length ?? 0;
DebugLogger.auth(
'token-updated',
scope: 'auth/api',
data: {'length': length},
);
}
syncToken(ref.read(apiServiceProvider), next);
});
});