Mobx 生成.g.dart文件

魏彦
2023-12-01
/// 步骤:
 1. 创建counter.dart
 2. 添加 part 'counter.g.dart';
 3. 添加 class Counter = CounterMobx with _$Counter;
 4. 执行命令: flutter packages pub run build_runner build
 5. 删除之内再生成: flutter packages pub run build_runner build --delete-conflicting-outputs
 6. 实时更新.g文件: flutter packages pub run build_runner watch

 类似资料: