|
|
@ -1,6 +1,7 @@ |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
import 'package:get/get.dart'; |
|
|
|
import 'package:get/get.dart'; |
|
|
|
|
|
|
|
import 'package:problem_check_system/app/routes/app_routes.dart'; |
|
|
|
import 'package:problem_check_system/modules/problem/controllers/problem_controller.dart'; |
|
|
|
import 'package:problem_check_system/modules/problem/controllers/problem_controller.dart'; |
|
|
|
import 'package:problem_check_system/modules/problem/views/problem_list_page.dart'; // 导入修正后的 ProblemListPage |
|
|
|
import 'package:problem_check_system/modules/problem/views/problem_list_page.dart'; // 导入修正后的 ProblemListPage |
|
|
|
import 'package:problem_check_system/modules/problem/views/problem_form_page.dart'; |
|
|
|
import 'package:problem_check_system/modules/problem/views/problem_form_page.dart'; |
|
|
@ -35,7 +36,7 @@ class ProblemPage extends GetView<ProblemController> { |
|
|
|
controller: controller.tabController, |
|
|
|
controller: controller.tabController, |
|
|
|
indicatorSize: TabBarIndicatorSize.tab, |
|
|
|
indicatorSize: TabBarIndicatorSize.tab, |
|
|
|
indicator: const BoxDecoration( |
|
|
|
indicator: const BoxDecoration( |
|
|
|
color: Color(0xfffff7f7), |
|
|
|
color: Color(0xfff7f7f7), |
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
topLeft: Radius.circular(8), |
|
|
|
topLeft: Radius.circular(8), |
|
|
|
topRight: Radius.circular(60), |
|
|
|
topRight: Radius.circular(60), |
|
|
@ -56,7 +57,7 @@ class ProblemPage extends GetView<ProblemController> { |
|
|
|
fontSize: 14.sp, |
|
|
|
fontSize: 14.sp, |
|
|
|
), |
|
|
|
), |
|
|
|
labelColor: Colors.black, |
|
|
|
labelColor: Colors.black, |
|
|
|
unselectedLabelColor: Colors.white, |
|
|
|
unselectedLabelColor: Color(0xfff7f7f7), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
Expanded( |
|
|
|
Expanded( |
|
|
@ -64,152 +65,113 @@ class ProblemPage extends GetView<ProblemController> { |
|
|
|
controller: controller.tabController, |
|
|
|
controller: controller.tabController, |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
// 问题列表 Tab |
|
|
|
// 问题列表 Tab |
|
|
|
Column( |
|
|
|
DecoratedBox( |
|
|
|
children: [ |
|
|
|
decoration: BoxDecoration(color: Color(0xfff7f7f7)), |
|
|
|
Container( |
|
|
|
child: Column( |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 17.w), |
|
|
|
children: [ |
|
|
|
child: Row( |
|
|
|
Container( |
|
|
|
children: [ |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 17.w), |
|
|
|
CustomDateRangeDropdown( |
|
|
|
child: Row( |
|
|
|
selectedRange: controller.selectedDateRange, |
|
|
|
children: [ |
|
|
|
onChanged: (rangeValue) { |
|
|
|
CustomDateRangeDropdown( |
|
|
|
controller.updateFiltersAndLoadProblems( |
|
|
|
selectedRange: controller.selectedDateRange, |
|
|
|
newDateRange: rangeValue, |
|
|
|
onChanged: (rangeValue) { |
|
|
|
); |
|
|
|
controller.updateFiltersAndLoadProblems( |
|
|
|
}, |
|
|
|
newDateRange: rangeValue, |
|
|
|
), |
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
|
|
CustomStringDropdown( |
|
|
|
CustomStringDropdown( |
|
|
|
selectedValue: controller.selectedUploadStatus, |
|
|
|
selectedValue: controller.selectedUploadStatus, |
|
|
|
items: const ['全部', '未上传', '已上传'], |
|
|
|
items: const ['全部', '未上传', '已上传'], |
|
|
|
onChanged: (uploadValue) { |
|
|
|
onChanged: (uploadValue) { |
|
|
|
controller.updateFiltersAndLoadProblems( |
|
|
|
controller.updateFiltersAndLoadProblems( |
|
|
|
newUploadStatus: uploadValue, |
|
|
|
newUploadStatus: uploadValue, |
|
|
|
); |
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
|
|
|
|
CustomStringDropdown( |
|
|
|
CustomStringDropdown( |
|
|
|
selectedValue: controller.selectedBindingStatus, |
|
|
|
selectedValue: controller.selectedBindingStatus, |
|
|
|
items: const ['全部', '未绑定', '已绑定'], |
|
|
|
items: const ['全部', '未绑定', '已绑定'], |
|
|
|
onChanged: (bindingValue) { |
|
|
|
onChanged: (bindingValue) { |
|
|
|
controller.updateFiltersAndLoadProblems( |
|
|
|
controller.updateFiltersAndLoadProblems( |
|
|
|
newBindingStatus: bindingValue, |
|
|
|
newBindingStatus: bindingValue, |
|
|
|
); |
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Expanded( |
|
|
|
Expanded( |
|
|
|
child: // 使用通用列表组件 |
|
|
|
child: // 使用通用列表组件 |
|
|
|
ProblemListPage( |
|
|
|
ProblemListPage( |
|
|
|
problemsToShow: controller.problems, |
|
|
|
problemsToShow: controller.problems, |
|
|
|
viewType: ProblemCardViewType.buttons, |
|
|
|
viewType: ProblemCardViewType.buttons, |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
// 历史问题列表 Tab |
|
|
|
// 历史问题列表 Tab |
|
|
|
Column( |
|
|
|
DecoratedBox( |
|
|
|
children: [ |
|
|
|
decoration: BoxDecoration(color: Color(0xfff7f7f7)), |
|
|
|
Container( |
|
|
|
child: Column( |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 17.w), |
|
|
|
children: [ |
|
|
|
child: Row( |
|
|
|
Container( |
|
|
|
children: [ |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 17.w), |
|
|
|
CustomDateRangeDropdown( |
|
|
|
child: Row( |
|
|
|
selectedRange: controller.selectedDateRange, |
|
|
|
children: [ |
|
|
|
onChanged: (rangeValue) { |
|
|
|
CustomDateRangeDropdown( |
|
|
|
controller.updateFiltersAndLoadProblems( |
|
|
|
selectedRange: controller.selectedDateRange, |
|
|
|
newDateRange: rangeValue, |
|
|
|
onChanged: (rangeValue) { |
|
|
|
); |
|
|
|
controller.updateFiltersAndLoadProblems( |
|
|
|
}, |
|
|
|
newDateRange: rangeValue, |
|
|
|
), |
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
|
|
CustomStringDropdown( |
|
|
|
CustomStringDropdown( |
|
|
|
selectedValue: controller.selectedUploadStatus, |
|
|
|
selectedValue: controller.selectedUploadStatus, |
|
|
|
items: const ['全部', '未上传', '已上传'], |
|
|
|
items: const ['全部', '未上传', '已上传'], |
|
|
|
onChanged: (uploadValue) { |
|
|
|
onChanged: (uploadValue) { |
|
|
|
controller.updateFiltersAndLoadProblems( |
|
|
|
controller.updateFiltersAndLoadProblems( |
|
|
|
newUploadStatus: uploadValue, |
|
|
|
newUploadStatus: uploadValue, |
|
|
|
); |
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
|
|
|
|
CustomStringDropdown( |
|
|
|
CustomStringDropdown( |
|
|
|
selectedValue: controller.selectedBindingStatus, |
|
|
|
selectedValue: controller.selectedBindingStatus, |
|
|
|
items: const ['全部', '未绑定', '已绑定'], |
|
|
|
items: const ['全部', '未绑定', '已绑定'], |
|
|
|
onChanged: (bindingValue) { |
|
|
|
onChanged: (bindingValue) { |
|
|
|
controller.updateFiltersAndLoadProblems( |
|
|
|
controller.updateFiltersAndLoadProblems( |
|
|
|
newBindingStatus: bindingValue, |
|
|
|
newBindingStatus: bindingValue, |
|
|
|
); |
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Expanded( |
|
|
|
Expanded( |
|
|
|
child: // 使用通用列表组件 |
|
|
|
child: // 使用通用列表组件 |
|
|
|
ProblemListPage( |
|
|
|
ProblemListPage( |
|
|
|
problemsToShow: controller.problems, |
|
|
|
problemsToShow: controller.problems, |
|
|
|
viewType: ProblemCardViewType.buttons, |
|
|
|
viewType: ProblemCardViewType.buttons, |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
// floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, |
|
|
|
|
|
|
|
// floatingActionButton: Stack( |
|
|
|
|
|
|
|
// children: [ |
|
|
|
|
|
|
|
// Align( |
|
|
|
|
|
|
|
// alignment: Alignment.bottomCenter, |
|
|
|
|
|
|
|
// child: FloatingActionButton( |
|
|
|
|
|
|
|
// heroTag: "btn_add", |
|
|
|
|
|
|
|
// onPressed: () { |
|
|
|
|
|
|
|
// Get.to(() => ProblemFormPage()); |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
// shape: const CircleBorder(), |
|
|
|
|
|
|
|
// backgroundColor: Colors.blue[300], |
|
|
|
|
|
|
|
// foregroundColor: Colors.white, |
|
|
|
|
|
|
|
// child: const Icon(Icons.add), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// Positioned( |
|
|
|
|
|
|
|
// right: controller.fabPosition.value.dx, //27.w, |
|
|
|
|
|
|
|
// bottom: controller.fabPosition.value.dy, //56.h, |
|
|
|
|
|
|
|
// child: Obx(() { |
|
|
|
|
|
|
|
// final bool isOnline = controller.isOnline.value; |
|
|
|
|
|
|
|
// return GestureDetector( |
|
|
|
|
|
|
|
// onPanUpdate: (details) { |
|
|
|
|
|
|
|
// // 调用控制器中的方法来更新位置 |
|
|
|
|
|
|
|
// controller.updatePosition(details.delta); |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
// child: FloatingActionButton( |
|
|
|
|
|
|
|
// heroTag: "btn_upload", |
|
|
|
|
|
|
|
// onPressed: isOnline |
|
|
|
|
|
|
|
// ? () => controller.uploadAllUnuploaded() |
|
|
|
|
|
|
|
// : null, |
|
|
|
|
|
|
|
// foregroundColor: Colors.white, |
|
|
|
|
|
|
|
// backgroundColor: isOnline |
|
|
|
|
|
|
|
// ? Colors.red[300] |
|
|
|
|
|
|
|
// : Colors.grey[400], |
|
|
|
|
|
|
|
// child: Icon( |
|
|
|
|
|
|
|
// isOnline |
|
|
|
|
|
|
|
// ? Icons.file_upload_outlined |
|
|
|
|
|
|
|
// : Icons.cloud_off_outlined, |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ); |
|
|
|
|
|
|
|
// }), |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
// ], |
|
|
|
|
|
|
|
// ), |
|
|
|
|
|
|
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, |
|
|
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, |
|
|
|
// 使用 Stack 统一管理所有浮动按钮 |
|
|
|
// 使用 Stack 统一管理所有浮动按钮 |
|
|
|
floatingActionButton: Stack( |
|
|
|
floatingActionButton: Stack( |
|
|
@ -252,7 +214,7 @@ class ProblemPage extends GetView<ProblemController> { |
|
|
|
child: FloatingActionButton( |
|
|
|
child: FloatingActionButton( |
|
|
|
heroTag: "btn_upload", |
|
|
|
heroTag: "btn_upload", |
|
|
|
onPressed: isOnline |
|
|
|
onPressed: isOnline |
|
|
|
? () => controller.uploadAllUnuploaded() |
|
|
|
? () => Get.toNamed(AppRoutes.problemUpload) |
|
|
|
: null, |
|
|
|
: null, |
|
|
|
foregroundColor: Colors.white, |
|
|
|
foregroundColor: Colors.white, |
|
|
|
backgroundColor: isOnline |
|
|
|
backgroundColor: isOnline |
|
|
|