重构事件信息页面,移除不必要的加载状态和错误消息字段,简化状态管理逻辑;在扫码页面中增强选手信息查询功能,添加加载提示和错误处理。
This commit is contained in:
@@ -2,17 +2,13 @@ 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;
|
||||
@@ -21,21 +17,14 @@ class EventInfoState {
|
||||
items.isEmpty ? profile.eventTitle : items.first.eventName;
|
||||
|
||||
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