chore: update markdown dependency and refactor streaming handling

- Added `markdown` dependency version `^7.2.1` in `pubspec.yaml`.
- Updated `pubspec.lock` to reflect the direct dependency change.
- Refactored `streaming_helper.dart` to utilize `StreamingResponseController` for better stream management.
- Enhanced `ChatMessagesNotifier` to handle message streams with improved formatting and error handling.
- Updated `StreamingMarkdownWidget` to streamline markdown rendering and support new configurations.
This commit is contained in:
cogwheel0
2025-09-30 20:49:02 +05:30
parent d3b64716b9
commit 7debb7a055
10 changed files with 451 additions and 301 deletions

View File

@@ -0,0 +1,25 @@
import 'package:flutter/widgets.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../../../core/models/chat_message.dart';
typedef AssistantResponseBuilder =
Widget Function(BuildContext context, AssistantResponseContext response);
class AssistantResponseContext {
const AssistantResponseContext({
required this.message,
required this.markdown,
required this.isStreaming,
required this.buildDefault,
});
final ChatMessage message;
final String markdown;
final bool isStreaming;
final WidgetBuilder buildDefault;
}
final assistantResponseBuilderProvider = Provider<AssistantResponseBuilder?>(
(_) => null,
);