重构记分数据模型,替换弓型和靶纸类型为 ID 及名称,更新相关页面以支持新配置。
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user