fix(chat): fix ChatBloc event callback and test reliability

- Fix onEvent callback initialization in ChatBloc constructor
- Add MockAgUiService to isolate test from mock API behavior
- Remove unnecessary non-null assertions in tests
This commit is contained in:
qzl
2026-02-28 14:41:21 +08:00
parent 92781ddbbe
commit d37677c533
9 changed files with 254 additions and 217 deletions
@@ -2,6 +2,9 @@ import 'package:json_annotation/json_annotation.dart';
part 'tool_result.g.dart';
/// Schema 版本常量
const _defaultSchemaVersion = 'v1';
/// 工具执行结果(给 AI 的原始数据)
@JsonSerializable()
class ToolResult {
@@ -31,7 +34,7 @@ class UiCard {
UiCard({
required this.cardType,
this.schemaVersion = 'v1',
this.schemaVersion = _defaultSchemaVersion,
required this.data,
this.actions,
});