重构事件注册模型并更新应用配置。更改不同环境的基本url,增强事件注册项结构,并改进ScanQrCodePage中的导航。在AuthViewModel中添加clearAuth方法,以便更好地进行状态管理。
This commit is contained in:
@@ -5,7 +5,7 @@ import 'package:recording_tool/app/router/app_navigator.dart';
|
||||
import 'package:recording_tool/features/events/model/model_event_info.dart';
|
||||
import 'package:recording_tool/features/events/state/state_event_info.dart';
|
||||
import 'package:recording_tool/features/events/view_model/view_model_event_info.dart';
|
||||
import 'package:recording_tool/features/recording/pages/page_record.dart';
|
||||
import 'package:recording_tool/shared/widgets/app_webview.dart';
|
||||
import 'package:recording_tool/shared/widgets/widgets.dart';
|
||||
|
||||
class EventInfoPage extends ConsumerStatefulWidget {
|
||||
@@ -29,14 +29,17 @@ class _EventInfoPageState extends ConsumerState<EventInfoPage> {
|
||||
}
|
||||
|
||||
Future<void> onItemTap(EventRegistrationItem item) async {
|
||||
debugPrint('item tapped: ${item.name}');
|
||||
debugPrint('item tapped: ${item.itemName}');
|
||||
await ref.read(eventInfoProvider.notifier).requestStreamKey(item);
|
||||
if (!mounted) return;
|
||||
final profile = ref.read(eventInfoProvider).profile;
|
||||
// final profile = ref.read(eventInfoProvider).profile;
|
||||
|
||||
/// 个人赛
|
||||
AppNavigator.push(
|
||||
RecordingPage(
|
||||
recordingContext: item.toRecordingContext(profile: profile),
|
||||
streamUrl: EventInfoPage.mockRtmpUrl,
|
||||
WebviewPage(
|
||||
url: 'https://drone.apptest.sportsx.cc/#/pages/h5/score-entry',
|
||||
eventRegistrationItem: item,
|
||||
playerId: widget.playerId,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -236,9 +239,9 @@ class _ScheduleCard extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
item.group.isEmpty
|
||||
? item.name
|
||||
: '${item.name} (${item.group})',
|
||||
item.groupName.isEmpty
|
||||
? item.itemName
|
||||
: '${item.itemName} (${item.groupName})',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
@@ -250,7 +253,7 @@ class _ScheduleCard extends StatelessWidget {
|
||||
),
|
||||
SizedBox(height: 26.h),
|
||||
Text(
|
||||
item.venue,
|
||||
item.matchPlace,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
@@ -261,7 +264,7 @@ class _ScheduleCard extends StatelessWidget {
|
||||
),
|
||||
SizedBox(height: 26.h),
|
||||
Text(
|
||||
item.time,
|
||||
item.scheduleTime,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
@@ -297,7 +300,7 @@ class _ScheduleBadge extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (item.status != null) {
|
||||
if (item.statusLabel != null) {
|
||||
return CustomPaint(
|
||||
painter: _CutCornerBorderPainter(color: const Color(0xFF7A7A7A)),
|
||||
child: SizedBox(
|
||||
@@ -305,7 +308,7 @@ class _ScheduleBadge extends StatelessWidget {
|
||||
height: 90.h,
|
||||
child: Center(
|
||||
child: Text(
|
||||
item.status!,
|
||||
item.statusLabel!,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 20.sp, color: const Color(0xFF2F2F2F)),
|
||||
@@ -316,7 +319,7 @@ class _ScheduleBadge extends StatelessWidget {
|
||||
}
|
||||
|
||||
return Text(
|
||||
item.laneNo ?? '',
|
||||
item.matchPlace,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
|
||||
Reference in New Issue
Block a user