更新 devtools_options.yaml 以启用 riverpod 和 shared_preferences 扩展;更新 AuthApi 枚举以添加 playerRegistrationList API;重构 Auth 页面以在用户已登录时直接导航到扫码页面;重构 EventInfoPage 以使用新的状态管理和加载赛事报名信息;更新扫码页面以导航到 EventInfoPage。
This commit is contained in:
@@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user