重构记分数据模型,替换弓型和靶纸类型为 ID 及名称,更新相关页面以支持新配置。

This commit is contained in:
2026-08-09 19:09:21 +08:00
parent e3d6fac6e1
commit 15700f918b
9 changed files with 1236 additions and 413 deletions
@@ -0,0 +1,7 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../domain/point_book_config.dart';
final pointBookConfigProvider = FutureProvider<PointBookConfig>((ref) {
return PointBookConfig.fromAsset();
});
@@ -40,8 +40,10 @@ class PointRecordsNotifier extends AsyncNotifier<List<PointRecord>> {
/// Creates a new draft from scoring parameters and returns it.
Future<PointRecord> createDraft({
required BowType bowType,
required TargetFaceType targetFaceType,
required int bowOptionId,
required String bowName,
required int targetOptionId,
required String targetName,
required int distanceMeters,
required int endCount,
required int arrowsPerEnd,
@@ -49,8 +51,10 @@ class PointRecordsNotifier extends AsyncNotifier<List<PointRecord>> {
}) async {
final isar = await _isar();
final draft = PointRecord.createDraft(
bowType: bowType,
targetFaceType: targetFaceType,
bowOptionId: bowOptionId,
bowName: bowName,
targetOptionId: targetOptionId,
targetName: targetName,
distanceMeters: distanceMeters,
endCount: endCount,
arrowsPerEnd: arrowsPerEnd,