更新 AuthApi 枚举以添加获取推流地址的 API 路径;重构 Auth 页面以优化输入控件和按钮布局;更新扫码页面以导航到录制页面。
This commit is contained in:
@@ -20,6 +20,7 @@ class _AuthPageWidgetState extends ConsumerState<AuthPageWidget> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = TextEditingController();
|
||||
_controller?.text = '555';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -36,46 +37,44 @@ class _AuthPageWidgetState extends ConsumerState<AuthPageWidget> {
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 180.h),
|
||||
Text('裁判工作台', style: TextStyle(fontSize: 50, color: Colors.black)),
|
||||
AppText('裁判工作台', fontSize: 30.sp),
|
||||
SizedBox(height: 20.h),
|
||||
Text('输入执裁口令', style: TextStyle(fontSize: 30, color: Colors.black)),
|
||||
SizedBox(height: 20.h),
|
||||
|
||||
SizedBox(
|
||||
width: 280.w,
|
||||
height: 80.h,
|
||||
child: AppTextField(initialValue: 'hhh', controller: _controller),
|
||||
Text(
|
||||
'输入执裁口令',
|
||||
style: TextStyle(fontSize: 18.sp, color: Colors.black),
|
||||
),
|
||||
SizedBox(height: 20.h),
|
||||
SizedBox(
|
||||
width: 280.w,
|
||||
height: 80.h,
|
||||
child: AppButton(
|
||||
label: '确定',
|
||||
onPressed: () async {
|
||||
final code = _controller?.text;
|
||||
final success = await ref
|
||||
.read(authProvider.notifier)
|
||||
.auth(code ?? '');
|
||||
if (!mounted) return;
|
||||
if (success) {
|
||||
AppNavigator.push(const ScanQrCodePage());
|
||||
return;
|
||||
}
|
||||
final message = ref.read(authProvider).errorMessage;
|
||||
if (message != null && message.isNotEmpty) {
|
||||
AppToast.show(message);
|
||||
}
|
||||
// return;
|
||||
// AppNavigator.push(
|
||||
// const WebviewPage(
|
||||
// url:
|
||||
// 'http://192.168.1.64:5173/#/pages/h5/score-entry?eventId=10237&scheduleId=113716750536806400&playerId=74300708945531007',
|
||||
// ),
|
||||
// );
|
||||
},
|
||||
variant: AppButtonVariant.secondary,
|
||||
isLoading: authState.isLoading,
|
||||
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.w),
|
||||
child: Column(
|
||||
children: [
|
||||
AppTextField(controller: _controller),
|
||||
SizedBox(height: 20.h),
|
||||
SizedBox(
|
||||
width: double.maxFinite,
|
||||
child: AppButton(
|
||||
label: '确定',
|
||||
onPressed: () async {
|
||||
final code = _controller?.text;
|
||||
final success = await ref
|
||||
.read(authProvider.notifier)
|
||||
.auth(code ?? '');
|
||||
if (!mounted) return;
|
||||
if (success) {
|
||||
AppNavigator.push(const ScanQrCodePage());
|
||||
return;
|
||||
}
|
||||
final message = ref.read(authProvider).errorMessage;
|
||||
if (message != null && message.isNotEmpty) {
|
||||
AppToast.show(message);
|
||||
}
|
||||
},
|
||||
variant: AppButtonVariant.secondary,
|
||||
isLoading: authState.isLoading,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:recording_tool/app/router/app_navigator.dart';
|
||||
import 'package:recording_tool/features/recording/pages/page_record.dart';
|
||||
import 'package:recording_tool/features/scan_qrcode/pages/page_push_test.dart';
|
||||
import 'package:recording_tool/shared/widgets/app_bar.dart';
|
||||
import 'package:recording_tool/shared/widgets/app_button.dart';
|
||||
@@ -40,7 +41,8 @@ class _AuthPageWidgetState extends State<ScanQrCodePage> {
|
||||
if (result == null || result.isEmpty) return;
|
||||
debugPrint('扫码结果: $result');
|
||||
Future.delayed(const Duration(milliseconds: 1)).then((_) {
|
||||
AppNavigator.push(PushSteamTestWidget(rtmpUrl: result));
|
||||
AppNavigator.push(const RecordingPage());
|
||||
// AppNavigator.push(PushSteamTestWidget(rtmpUrl: result));
|
||||
// AppNavigator.push(
|
||||
// const WebviewPage(url: 'https://www.dronex.cc/'),
|
||||
// );
|
||||
|
||||
Reference in New Issue
Block a user