|
@@ -5,7 +5,6 @@ import 'package:get/get.dart';
|
|
|
import 'package:plugin_basic/base/base_state.dart';
|
|
|
import 'package:plugin_basic/base/base_stateful_page.dart';
|
|
|
import 'package:plugin_basic/utils/ext_get_nav.dart';
|
|
|
-import 'package:plugin_platform/engine/toast/toast_engine.dart';
|
|
|
import 'package:router/path/router_path.dart';
|
|
|
import 'package:shared/utils/screen_util.dart';
|
|
|
import 'package:widgets/ext/ex_widget.dart';
|
|
@@ -51,117 +50,114 @@ class _LabourRequestListState extends BaseState<LabourRequestListPage, LabourReq
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
return autoCtlGetBuilder(builder: (controller) {
|
|
|
- return Scaffold(
|
|
|
- extendBodyBehindAppBar: true,
|
|
|
- appBar: MyAppBar.appSearchBar(
|
|
|
- context,
|
|
|
- value: state.keyword,
|
|
|
- hintText: 'Title'.tr,
|
|
|
- controller: state.searchController,
|
|
|
- onSearch: (keyword) {
|
|
|
- controller.doSearch(keyword);
|
|
|
- },
|
|
|
- actions: [
|
|
|
- //重置按钮
|
|
|
- MyButton(
|
|
|
- onPressed: () {
|
|
|
- FocusScope.of(context).unfocus();
|
|
|
- controller.resetFiltering();
|
|
|
- },
|
|
|
- text: "Reset".tr,
|
|
|
- textColor: ColorConstants.white,
|
|
|
- backgroundColor: hexToColor("#2BA9F9", opacity: 0.5),
|
|
|
- radius: 17.25,
|
|
|
- minWidth: 60,
|
|
|
- minHeight: 35,
|
|
|
- ).marginOnly(right: 15),
|
|
|
+ return SafeArea(
|
|
|
+ bottom: true,
|
|
|
+ top: false,
|
|
|
+ child: Container(
|
|
|
+ width: double.infinity,
|
|
|
+ height: double.infinity,
|
|
|
+ padding: EdgeInsets.only(top: ScreenUtil.getStatusBarH(context)),
|
|
|
+ decoration: const BoxDecoration(
|
|
|
+ gradient: LinearGradient(
|
|
|
+ colors: [
|
|
|
+ Color(0xFF091D44),
|
|
|
+ Color(0xFF245A8A),
|
|
|
+ Color(0xFF7F7CEC),
|
|
|
+ ],
|
|
|
+ begin: Alignment.topCenter,
|
|
|
+ end: Alignment.bottomCenter,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ MyAppBar.searchTitleBar(
|
|
|
+ context,
|
|
|
+ value: state.keyword,
|
|
|
+ hintText: 'Title'.tr,
|
|
|
+ controller: state.searchController,
|
|
|
+ onSearch: (keyword) {
|
|
|
+ controller.doSearch(keyword);
|
|
|
+ },
|
|
|
+ actions: [
|
|
|
+ //重置按钮
|
|
|
+ MyButton(
|
|
|
+ onPressed: () {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ controller.resetFiltering();
|
|
|
+ },
|
|
|
+ text: "Reset".tr,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ backgroundColor: hexToColor("#2BA9F9", opacity: 0.5),
|
|
|
+ radius: 17.25,
|
|
|
+ minWidth: 60,
|
|
|
+ minHeight: 35,
|
|
|
+ ).marginOnly(right: 15),
|
|
|
|
|
|
- //筛选图标
|
|
|
- MyAssetImage(
|
|
|
- Assets.baseServiceTitleBarFilterIcon,
|
|
|
- width: 24,
|
|
|
- height: 16.5,
|
|
|
- ).onTap(() {
|
|
|
- FocusScope.of(context).unfocus();
|
|
|
- controller.showFilterDialog();
|
|
|
- }).marginOnly(right: 15),
|
|
|
- ],
|
|
|
- ),
|
|
|
- body: SafeArea(
|
|
|
- bottom: true,
|
|
|
- top: false,
|
|
|
- child: Container(
|
|
|
- width: double.infinity,
|
|
|
- height: double.infinity,
|
|
|
- padding: EdgeInsets.only(top: kToolbarHeight + ScreenUtil.getStatusBarH(context) + 1),
|
|
|
- decoration: const BoxDecoration(
|
|
|
- gradient: LinearGradient(
|
|
|
- colors: [
|
|
|
- Color(0xFF091D44),
|
|
|
- Color(0xFF245A8A),
|
|
|
- Color(0xFF7F7CEC),
|
|
|
+ //筛选图标
|
|
|
+ MyAssetImage(
|
|
|
+ Assets.baseServiceTitleBarFilterIcon,
|
|
|
+ width: 24,
|
|
|
+ height: 16.5,
|
|
|
+ ).onTap(() {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ controller.showFilterDialog();
|
|
|
+ }).marginOnly(right: 15),
|
|
|
],
|
|
|
- begin: Alignment.topCenter,
|
|
|
- end: Alignment.bottomCenter,
|
|
|
),
|
|
|
- ),
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- // 添加按钮
|
|
|
- MyButton(
|
|
|
- type: ClickType.throttle,
|
|
|
- milliseconds: 500,
|
|
|
- onPressed: () {
|
|
|
- FocusScope.of(context).unfocus();
|
|
|
- controller.gotoAddLabourPage();
|
|
|
- },
|
|
|
- text: "Create New Job Request".tr,
|
|
|
- textColor: ColorConstants.white,
|
|
|
- fontSize: 16,
|
|
|
- radius: 20,
|
|
|
- backgroundColor: hexToColor("#FFBB1B"),
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
- ).marginSymmetric(horizontal: 15, vertical: 15),
|
|
|
+ // 添加按钮
|
|
|
+ MyButton(
|
|
|
+ type: ClickType.throttle,
|
|
|
+ milliseconds: 500,
|
|
|
+ onPressed: () {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ controller.gotoAddLabourPage();
|
|
|
+ },
|
|
|
+ text: "Create New Job Request".tr,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ fontSize: 16,
|
|
|
+ radius: 20,
|
|
|
+ backgroundColor: hexToColor("#FFBB1B"),
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
+ ).marginSymmetric(horizontal: 15, vertical: 15),
|
|
|
|
|
|
- //底部的列表
|
|
|
- EasyRefresh(
|
|
|
- controller: controller.refreshController,
|
|
|
- onRefresh: controller.onRefresh,
|
|
|
- onLoad: controller.loadMore,
|
|
|
- child: LoadStateLayout(
|
|
|
- state: controller.loadingState,
|
|
|
- errorMessage: controller.errorMessage,
|
|
|
- errorRetry: () {
|
|
|
- controller.retryRequest();
|
|
|
- },
|
|
|
- successSliverWidget: [
|
|
|
- SliverList(
|
|
|
- delegate: SliverChildBuilderDelegate(
|
|
|
- (context, index) {
|
|
|
- return LabourRequestItem(
|
|
|
- index: index,
|
|
|
- item: state.datas[index],
|
|
|
- onDetailAction: (){
|
|
|
+ //底部的列表
|
|
|
+ EasyRefresh(
|
|
|
+ controller: controller.refreshController,
|
|
|
+ onRefresh: controller.onRefresh,
|
|
|
+ onLoad: controller.loadMore,
|
|
|
+ child: LoadStateLayout(
|
|
|
+ state: controller.loadingState,
|
|
|
+ errorMessage: controller.errorMessage,
|
|
|
+ errorRetry: () {
|
|
|
+ controller.retryRequest();
|
|
|
+ },
|
|
|
+ successSliverWidget: [
|
|
|
+ SliverList(
|
|
|
+ delegate: SliverChildBuilderDelegate(
|
|
|
+ (context, index) {
|
|
|
+ return LabourRequestItem(
|
|
|
+ index: index,
|
|
|
+ item: state.datas[index],
|
|
|
+ onDetailAction: () {
|
|
|
controller.gotoDetailPage(state.datas[index]);
|
|
|
- },
|
|
|
- onRecallAction: (){
|
|
|
- controller.doRecall(state.datas[index]);
|
|
|
- },
|
|
|
- onEditAction: (){
|
|
|
- controller.gotoEditPage(state.datas[index]);
|
|
|
- },
|
|
|
- onStatusAction: (){
|
|
|
- controller.gotoWorkflowPage(state.datas[index]);
|
|
|
- },
|
|
|
- );
|
|
|
- },
|
|
|
- childCount: state.datas.length,
|
|
|
- ))
|
|
|
- ],
|
|
|
- ),
|
|
|
- ).expanded(),
|
|
|
- ],
|
|
|
- ),
|
|
|
+ },
|
|
|
+ onRecallAction: () {
|
|
|
+ controller.doRecall(state.datas[index]);
|
|
|
+ },
|
|
|
+ onEditAction: () {
|
|
|
+ controller.gotoEditPage(state.datas[index]);
|
|
|
+ },
|
|
|
+ onStatusAction: () {
|
|
|
+ controller.gotoWorkflowPage(state.datas[index]);
|
|
|
+ },
|
|
|
+ );
|
|
|
+ },
|
|
|
+ childCount: state.datas.length,
|
|
|
+ ))
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ).expanded(),
|
|
|
+ ],
|
|
|
),
|
|
|
),
|
|
|
);
|