@@ -32,22 +32,6 @@ class _RacePage extends State<RacePage> {
3232
3333 _RacePage (this .raceName);
3434
35- ExportType exportType = ExportType .asDivision;
36-
37- void handleExportTypeChange (ExportType ? value) {
38- setState (() {
39- exportType = value! ;
40- });
41- }
42-
43- bool isContainPronePaddle = false ;
44-
45- void handlePronePaddleChange (bool ? value) {
46- setState (() {
47- isContainPronePaddle = value! ;
48- });
49- }
50-
5135 @override
5236 void initState () {
5337 super .initState ();
@@ -69,7 +53,7 @@ class _RacePage extends State<RacePage> {
6953 builder: (context, snapshot) {
7054 if (snapshot.connectionState == ConnectionState .done) {
7155 return RaceNameCard (
72- title: '6000米长距离赛(青少年3000米) ' ,
56+ title: '长距离赛 ' ,
7357 raceName: raceName,
7458 // subtitle: "点击进入",
7559 clickable: snapshot.data as bool );
@@ -82,7 +66,7 @@ class _RacePage extends State<RacePage> {
8266 builder: (context, snapshot) {
8367 if (snapshot.connectionState == ConnectionState .done) {
8468 return RaceNameCard (
85- title: '200米趴板划水赛(仅限青少年 )' ,
69+ title: '趴板划水赛(仅青少年 )' ,
8670 raceName: raceName,
8771 // subtitle: "点击进入",
8872 clickable: snapshot.data as bool );
@@ -95,7 +79,7 @@ class _RacePage extends State<RacePage> {
9579 builder: (context, snapshot) {
9680 if (snapshot.connectionState == ConnectionState .done) {
9781 return RaceNameCard (
98- title: '500米竞速赛 ' ,
82+ title: '竞速赛 ' ,
9983 raceName: raceName,
10084 // subtitle: "点击进入",
10185 clickable: snapshot.data as bool );
@@ -123,80 +107,8 @@ class _RacePage extends State<RacePage> {
123107 borderRadius: BorderRadius .circular (12.0 ),
124108 onTap: () async {
125109 /// 跳转到exportPage
126- Navigator .pushNamed (context, '/export' ,
127- arguments: raceName);
128- var choice = await showDialog <String >(
129- context: context,
130- barrierDismissible: false ,
131- builder: (BuildContext context) {
132- return AlertDialog (
133- title: const Text ("请选择导出类型" ),
134- actions: < Widget > [
135- RadioListTile <ExportType >(
136- title: Text ('按组别导出' ),
137- value: ExportType .asDivision,
138- groupValue: exportType,
139- onChanged: handleExportTypeChange,
140- ),
141- RadioListTile <ExportType >(
142- title: Text ('按代表队导出' ),
143- value: ExportType .asTeam,
144- groupValue: exportType,
145- onChanged: handleExportTypeChange,
146- ),
147- TextButton (
148- onPressed: () => Navigator .pop (context, null ),
149- child: const Text ('取消' ),
150- ),
151- TextButton (
152- // 这里添加了空的Text widget
153- onPressed: () => Navigator .pop (context, "A" ),
154- child: const Text ('按组别导出' ), // 补全了 child 属性
155- ),
156- TextButton (
157- onPressed: () => Navigator .pop (context, "B" ),
158- child: const Text ('按代表队导出' ),
159- ),
160- ],
161- );
162- },
163- );
164- Loading .startLoading ("导出中" , context);
165- List <int > finalScoreBinary;
166- if (choice == 'A' ) {
167- finalScoreBinary = await DataHelper .exportFinalScore (
168- raceName, ExportType .asDivision);
169- } else if (choice == 'B' ) {
170- finalScoreBinary = await DataHelper .exportFinalScore (
171- raceName, ExportType .asTeam);
172- } else {
173- Loading .stopLoading (context);
174- return ;
175- }
176- try {
177- await Future .delayed (Duration .zero, () async {
178- String ? filePath = await FilePicker .platform.saveFile (
179- dialogTitle: '保存个人积分' ,
180- fileName: '个人积分 - $raceName .xlsx' ,
181- );
182- if (filePath == null ) {
183- throw Exception ("用户未选择文件" );
184- } else {
185- File file = File (filePath);
186-
187- // printDebug("!!TEST!!$choice");
188-
189- await file.writeAsBytes (finalScoreBinary);
190- printDebug ("文件已保存到:$filePath " );
191- ScaffoldMessenger .of (context).showSnackBar (
192- const SnackBar (content: Text ('积分表下载完成' )),
193- );
194- Loading .stopLoading (context);
195- }
196- });
197- } catch (e) {
198- Loading .stopLoading (context);
199- }
110+ printDebug ("跳转到/export/$raceName " );
111+ Navigator .pushNamed (context, '/export' , arguments: raceName);
200112 },
201113 child: const ListTile (
202114 title: Text ('导出比赛积分表' ),
0 commit comments