更新 devtools_options.yaml 以启用 riverpod 和 shared_preferences 扩展;更新 AuthApi 枚举以添加 playerRegistrationList API;重构 Auth 页面以在用户已登录时直接导航到扫码页面;重构 EventInfoPage 以使用新的状态管理和加载赛事报名信息;更新扫码页面以导航到 EventInfoPage。

This commit is contained in:
2026-07-09 17:38:56 +08:00
parent 6138eddc16
commit 1c909277ff
11 changed files with 646 additions and 137 deletions
@@ -0,0 +1,44 @@
import 'package:recording_tool/features/events/model/model_event_info.dart';
class EventInfoState {
const EventInfoState({
this.isLoading = false,
this.isRequestingStreamKey = false,
this.errorMessage,
this.profile = const EventProfile(name: '', phone: '', eventTitle: '赛事信息'),
this.total = 0,
this.items = const [],
});
final bool isLoading;
final bool isRequestingStreamKey;
final String? errorMessage;
final EventProfile profile;
final int total;
final List<EventRegistrationItem> items;
String get eventTitle =>
items.isEmpty ? profile.eventTitle : items.first.eventTitle;
EventInfoState copyWith({
bool? isLoading,
bool? isRequestingStreamKey,
String? errorMessage,
bool clearErrorMessage = false,
EventProfile? profile,
int? total,
List<EventRegistrationItem>? items,
}) {
return EventInfoState(
isLoading: isLoading ?? this.isLoading,
isRequestingStreamKey:
isRequestingStreamKey ?? this.isRequestingStreamKey,
errorMessage: clearErrorMessage
? null
: (errorMessage ?? this.errorMessage),
profile: profile ?? this.profile,
total: total ?? this.total,
items: items ?? this.items,
);
}
}