添加mobile_scanner包,

添加AuthPageWidget
添加全局扫码组件
This commit is contained in:
2026-07-07 17:16:51 +08:00
parent 26574808df
commit 1246e41e4b
6 changed files with 444 additions and 2 deletions
+50
View File
@@ -0,0 +1,50 @@
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/scan_qrcode/pages/page_scan_qrcode.dart';
import 'package:recording_tool/shared/widgets/widgets.dart';
class AuthPageWidget extends StatefulWidget {
const AuthPageWidget({super.key});
@override
State<AuthPageWidget> createState() => _AuthPageWidgetState();
}
class _AuthPageWidgetState extends State<AuthPageWidget> {
@override
Widget build(BuildContext context) {
return Center(
child: Column(
children: [
SizedBox(height: 180.h),
Text('裁判工作台', style: TextStyle(fontSize: 50, color: Colors.black)),
SizedBox(height: 20.h),
Text(
'Auth Page',
style: TextStyle(fontSize: 30, color: Colors.black),
),
SizedBox(height: 20.h),
SizedBox(
width: 280.w,
height: 80.h,
child: AppTextField(initialValue: 'hhh'),
),
SizedBox(height: 20.h),
SizedBox(
width: 280.w,
height: 80.h,
child: AppButton(
label: '确定',
onPressed: () {
AppNavigator.push(const ScanQrCodePage());
},
variant: AppButtonVariant.secondary,
),
),
],
),
);
}
}
@@ -0,0 +1,59 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:recording_tool/shared/widgets/app_button.dart';
import 'package:recording_tool/shared/widgets/app_qr_scanner_dialog.dart';
class ScanQrCodePage extends StatefulWidget {
const ScanQrCodePage({super.key});
@override
State<ScanQrCodePage> createState() => _AuthPageWidgetState();
}
class _AuthPageWidgetState extends State<ScanQrCodePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: IconButton(
icon: const Icon(Icons.arrow_back),
onPressed: () {
Navigator.of(context).maybePop();
},
),
centerTitle: true,
elevation: 0,
backgroundColor: Colors.transparent,
foregroundColor: Colors.black,
),
body: Center(
child: Column(
children: [
SizedBox(height: 100.h),
Text('裁判工作台', style: TextStyle(fontSize: 30, color: Colors.black)),
SizedBox(height: 100.h),
Text(
'扫描选手参赛凭证进行执裁',
style: TextStyle(fontSize: 30, color: Colors.black),
),
SizedBox(height: 20.h),
SizedBox(
width: 280.w,
height: 80.h,
child: AppButton(
label: '扫码',
onPressed: () async {
final result = await AppQrScannerDialog.show(context);
if (result == null || result.isEmpty) return;
debugPrint('扫码结果: $result');
},
variant: AppButtonVariant.secondary,
),
),
],
),
),
);
}
}