work_page.dart 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741
  1. import 'dart:async';
  2. import 'package:flustars/flustars.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:liftmanager/common/common.dart';
  5. import 'package:liftmanager/internal/bbs/bbs_router.dart';
  6. import 'package:liftmanager/internal/heavy/heavy_router.dart';
  7. import 'package:liftmanager/internal/maintenance/maintenance_router.dart';
  8. import 'package:liftmanager/internal/message/message_router.dart';
  9. import 'package:liftmanager/internal/project/project_router.dart';
  10. import 'package:liftmanager/internal/repair/repair_router.dart';
  11. import 'package:liftmanager/internal/sign/sign_router.dart';
  12. import 'package:liftmanager/internal/team/team_router.dart';
  13. import 'package:liftmanager/internal/work/model/banner_entity.dart';
  14. import 'package:liftmanager/internal/work/model/count_doing_item.dart';
  15. import 'package:liftmanager/internal/work/provider/work_page_provider.dart';
  16. import 'package:liftmanager/internal/work/work_router.dart';
  17. import 'package:liftmanager/internal/yearly/yearly_router.dart';
  18. import 'package:liftmanager/net/api_service.dart';
  19. import 'package:liftmanager/res/resources.dart';
  20. import 'package:liftmanager/routers/fluro_navigator.dart';
  21. import 'package:liftmanager/utils/theme_utils.dart';
  22. import 'package:liftmanager/utils/toast.dart';
  23. import 'package:liftmanager/utils/utils.dart';
  24. import 'package:liftmanager/widgets/load_image.dart';
  25. import 'package:liftmanager/widgets/my_card.dart';
  26. import 'package:liftmanager/widgets/my_flexible_space_bar.dart';
  27. import 'package:oktoast/oktoast.dart';
  28. import 'package:provider/provider.dart';
  29. import 'package:flutter_screenutil/flutter_screenutil.dart' as su;
  30. const timeout = const Duration(seconds: 5);
  31. CountDoingItem countDoingItem = CountDoingItem();
  32. int caseNum = 0;
  33. class WorkPage extends StatefulWidget {
  34. @override
  35. State<StatefulWidget> createState() {
  36. return _WorkPageState();
  37. }
  38. }
  39. class _WorkPageState extends State<WorkPage> with TickerProviderStateMixin {
  40. WorkPageProvider provider = WorkPageProvider();
  41. TabController _tabController;
  42. PageController _pageController = PageController();
  43. int _index = 0;
  44. Timer _timer;
  45. List<BannerEntity> bannerList = [];
  46. // FToast fToast;
  47. @override
  48. void initState() {
  49. _tabController = TabController(length: 0, vsync: this);
  50. _timer = Timer.periodic(timeout, _handleTimeout);
  51. getBanner();
  52. countDoing();
  53. getCaseNum();
  54. super.initState();
  55. // fToast = FToast(context);
  56. }
  57. @override
  58. void dispose() {
  59. _tabController?.dispose();
  60. _timer.cancel();
  61. _pageController.dispose();
  62. super.dispose();
  63. }
  64. void getBanner() {
  65. ApiService(context: context).getBanner(onSuccess: (data) {
  66. if (!mounted) {
  67. return;
  68. }
  69. bannerList = data; //todo
  70. if (bannerList.length > 0) {
  71. _pageController.jumpToPage(0);
  72. _tabController = TabController(length: bannerList.length, vsync: this);
  73. setState(() {});
  74. }
  75. }, onError: (code, msg) {
  76. showToast(msg);
  77. });
  78. }
  79. void countDoing() {
  80. ApiService(context: context).countDoing(onSuccess: (data) {
  81. if (!mounted) return;
  82. setState(() {
  83. countDoingItem = data; //todo
  84. });
  85. }, onError: (code, msg) {
  86. // showToast(msg);
  87. });
  88. }
  89. void getCaseNum() {
  90. // liftCases/getUndealedCaseNum
  91. ApiService(context: context).getcaseNum(onSuccess: (data) {
  92. if (!mounted) return;
  93. setState(() {
  94. caseNum = data ?? 0;
  95. // countDoingItem = data; //todo
  96. });
  97. }, onError: (code, msg) {
  98. // showToast(msg);
  99. });
  100. }
  101. _handleTimeout(Timer timer) {
  102. _index++;
  103. _pageController.animateToPage(
  104. _index % (bannerList.length == 0 ? 1 : bannerList.length),
  105. duration: Duration(milliseconds: 16),
  106. curve: Curves.fastOutSlowIn,
  107. );
  108. }
  109. void _onPageChanged(int index) {
  110. _index = index;
  111. _tabController.animateTo(index);
  112. }
  113. goToPage(pagePath) {
  114. NavigatorUtils.pushResult(context, pagePath, (res) {
  115. countDoing();
  116. });
  117. }
  118. @override
  119. Widget build(BuildContext context) {
  120. return ChangeNotifierProvider<WorkPageProvider>(
  121. create: (_) => provider,
  122. child: Scaffold(
  123. backgroundColor: ThemeUtils.getTabsBg(context),
  124. body: CustomScrollView(
  125. key: const Key('statistic_list'),
  126. physics: ClampingScrollPhysics(),
  127. slivers: _sliverBuilder(),
  128. ),
  129. ));
  130. }
  131. Widget bannerWidget() {
  132. bool isDark = ThemeUtils.isDark(context);
  133. return Container(
  134. // height: 280,
  135. child: Stack(
  136. children: <Widget>[
  137. Container(
  138. height: 210,
  139. child: PageView(
  140. children: bannerList.map((item) {
  141. return GestureDetector(
  142. onTap: () {
  143. if (item.url.length > 0) {
  144. goToPage("${WorkRouter.webview}?title=" +
  145. Uri.encodeComponent("详情") +
  146. "&url=" +
  147. Uri.encodeComponent(item.url));
  148. }
  149. },
  150. child: Image.network(
  151. item.image ?? "",
  152. fit: BoxFit.fill, //使照片占满整个屏幕
  153. ),
  154. );
  155. }).toList(),
  156. onPageChanged: _onPageChanged,
  157. controller: _pageController,
  158. ),
  159. ),
  160. // Align(
  161. // alignment: Alignment(0.0, 0.9),
  162. // child: TabPageSelector(
  163. // color: Colors.white,
  164. // selectedColor: Colours.app_main,
  165. // controller: _tabController,
  166. // ),
  167. // ),
  168. Positioned(
  169. right: 10,
  170. left: 10,
  171. bottom: 0,
  172. child: MyCard(
  173. // shadowColor: Colors.red,
  174. child: Container(
  175. color: isDark ? Colours.dark_bg_color : Colors.white,
  176. height: 90.0,
  177. padding: const EdgeInsets.only(top: 8.0),
  178. child: Row(
  179. mainAxisAlignment: MainAxisAlignment.spaceAround,
  180. children: <Widget>[
  181. _TabView(
  182. 0,
  183. '待保养',
  184. onTap: () {
  185. if (SpUtil.getString(Constant.companyId).length == 0) {
  186. showAlert(
  187. context,
  188. "提示",
  189. "尚未加入团队,是否立即加入?",
  190. "确定",
  191. () {
  192. NavigatorUtils.goBack(context);
  193. // NavigatorUtils.goBackWithParams(context, true);
  194. goToPage(TeamRouter.teamListPage);
  195. },
  196. txt2: "取消",
  197. onPre2: () {
  198. NavigatorUtils.goBack(context);
  199. // NavigatorUtils.goBackWithParams(context, true);
  200. });
  201. } else {
  202. goToPage(
  203. "${MaintenanceRouter.maintenanceListPage}?top_into=0");
  204. }
  205. },
  206. ),
  207. _TabView(
  208. 1,
  209. '待急修',
  210. onTap: () {
  211. if (SpUtil.getString(Constant.companyId).length == 0) {
  212. showAlert(
  213. context,
  214. "提示",
  215. "尚未加入团队,是否立即加入?",
  216. "确定",
  217. () {
  218. NavigatorUtils.goBack(context);
  219. goToPage(TeamRouter.teamListPage);
  220. },
  221. txt2: "取消",
  222. onPre2: () {
  223. NavigatorUtils.goBack(context);
  224. });
  225. } else {
  226. goToPage("${RepairRouter.repairListPage}?top_into=1");
  227. }
  228. },
  229. ),
  230. _TabView(
  231. 2,
  232. '待年检',
  233. onTap: () {
  234. if (SpUtil.getString(Constant.companyId).length == 0) {
  235. showAlert(
  236. context,
  237. "提示",
  238. "尚未加入团队,是否立即加入?",
  239. "确定",
  240. () {
  241. NavigatorUtils.goBack(context);
  242. goToPage(TeamRouter.teamListPage);
  243. },
  244. txt2: "取消",
  245. onPre2: () {
  246. NavigatorUtils.goBack(context);
  247. });
  248. } else {
  249. goToPage("${YearlyRouter.yearlyListPage}?top_into=1");
  250. }
  251. },
  252. ),
  253. _TabView(
  254. 3,
  255. '待大修',
  256. onTap: () {
  257. if (SpUtil.getString(Constant.companyId).length == 0) {
  258. showAlert(
  259. context,
  260. "提示",
  261. "尚未加入团队,是否立即加入?",
  262. "确定",
  263. () {
  264. NavigatorUtils.goBack(context);
  265. goToPage(TeamRouter.teamListPage);
  266. },
  267. txt2: "取消",
  268. onPre2: () {
  269. NavigatorUtils.goBack(context);
  270. });
  271. } else {
  272. goToPage("${HeavyRouter.heavyListPage}?top_into=1");
  273. }
  274. },
  275. ),
  276. ],
  277. )),
  278. ),
  279. )
  280. ],
  281. ));
  282. }
  283. List<Widget> _sliverBuilder() {
  284. bool isDark = ThemeUtils.isDark(context);
  285. return <Widget>[
  286. SliverAppBar(
  287. brightness: Brightness.dark,
  288. leading: Gaps.empty,
  289. backgroundColor: Colors.transparent,
  290. elevation: 0.0,
  291. centerTitle: true,
  292. expandedHeight: 240.0,
  293. pinned: true,
  294. flexibleSpace: MyFlexibleSpaceBar(
  295. background: bannerWidget(),
  296. // const LoadAssetImage(
  297. // "work/statistic_bg",
  298. // width: double.infinity,
  299. // height: 138.0,
  300. // fit: BoxFit.fill,
  301. // ),
  302. centerTitle: true,
  303. titlePadding:
  304. const EdgeInsetsDirectional.only(start: 16.0, bottom: 14.0),
  305. collapseMode: CollapseMode.pin,
  306. title: Text(
  307. '',
  308. style: TextStyle(color: ThemeUtils.getIconColor(context)),
  309. ),
  310. ),
  311. ),
  312. // SliverPersistentHeader(
  313. // pinned: true,
  314. // delegate: SliverAppBarDelegate(
  315. // DecoratedBox(
  316. // decoration: BoxDecoration(
  317. // // image: DecorationImage(
  318. // // image: ImageUtils.getAssetImage("work/statistic_bg1"),
  319. // // fit: BoxFit.fill)
  320. // ),
  321. // child: Column(
  322. // children: <Widget>[
  323. // MyCard(
  324. // child: Container(
  325. // color: isDark?Colours.dark_bg_color:Colors.white,
  326. // height: 90.0,
  327. // padding: const EdgeInsets.only(top: 8.0),
  328. // child: Row(
  329. // mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  330. // children: <Widget>[
  331. // _TabView(0, '待保养',onTap: (){
  332. // if (SpUtil.getString(Constant.companyId).length == 0) {
  333. // showAlert(
  334. // context,
  335. // "提示",
  336. // "尚未加入团队,是否立即加入?",
  337. // "确定",
  338. // () {
  339. // NavigatorUtils.goBack(context);
  340. // // NavigatorUtils.goBackWithParams(context, true);
  341. // goToPage(TeamRouter.teamListPage);
  342. // },
  343. // txt2: "取消",
  344. // onPre2: () {
  345. // NavigatorUtils.goBack(context);
  346. // // NavigatorUtils.goBackWithParams(context, true);
  347. // });
  348. // }else{
  349. // goToPage("${MaintenanceRouter.maintenanceListPage}?top_into=0");
  350. // }
  351. // },),
  352. // _TabView(1, '待急修',onTap: (){
  353. // if (SpUtil.getString(Constant.companyId).length == 0) {
  354. // showAlert(
  355. // context,
  356. // "提示",
  357. // "尚未加入团队,是否立即加入?",
  358. // "确定",
  359. // () {
  360. // NavigatorUtils.goBack(context);
  361. // goToPage(TeamRouter.teamListPage);
  362. // },
  363. // txt2: "取消",
  364. // onPre2: () {
  365. // NavigatorUtils.goBack(context);
  366. // });
  367. // }else{
  368. // goToPage("${RepairRouter.repairListPage}?top_into=1");
  369. // }
  370. // },),
  371. // _TabView(2, '待年检',onTap: (){
  372. // if (SpUtil.getString(Constant.companyId).length == 0) {
  373. // showAlert(
  374. // context,
  375. // "提示",
  376. // "尚未加入团队,是否立即加入?",
  377. // "确定",
  378. // () {
  379. // NavigatorUtils.goBack(context);
  380. // goToPage(TeamRouter.teamListPage);
  381. // },
  382. // txt2: "取消",
  383. // onPre2: () {
  384. // NavigatorUtils.goBack(context);
  385. // });
  386. // }else{
  387. // goToPage("${YearlyRouter.yearlyListPage}?top_into=1");
  388. // }
  389. // },),
  390. // _TabView(3, '待大修',onTap: (){
  391. // if (SpUtil.getString(Constant.companyId).length == 0) {
  392. // showAlert(
  393. // context,
  394. // "提示",
  395. // "尚未加入团队,是否立即加入?",
  396. // "确定",
  397. // () {
  398. // NavigatorUtils.goBack(context);
  399. // goToPage(TeamRouter.teamListPage);
  400. // },
  401. // txt2: "取消",
  402. // onPre2: () {
  403. // NavigatorUtils.goBack(context);
  404. // });
  405. // }else{
  406. // goToPage("${HeavyRouter.heavyListPage}?top_into=1");
  407. // }
  408. // },),
  409. // ],
  410. // )),
  411. // ),
  412. // ],
  413. // ),
  414. // ),
  415. // 90.0),
  416. // ),
  417. SliverToBoxAdapter(
  418. child: Padding(
  419. padding: const EdgeInsets.symmetric(horizontal: 0),
  420. child: Column(
  421. crossAxisAlignment: CrossAxisAlignment.start,
  422. children: <Widget>[
  423. // Gaps.vGap16,
  424. Gaps.vGap16,
  425. Container(
  426. padding: EdgeInsets.only(left: 20, right: 20),
  427. child: const Text("必备工具", style: TextStyles.textBold15),
  428. ),
  429. Gaps.vGap10,
  430. _ToolsItem(menuTitle, menuImage, (index) {
  431. if (index == 7) {
  432. if (Utils.getAuthByRouter(
  433. context, "expert_workbench", false)) {
  434. NavigatorUtils.push(context, BbsRouter.workPlace);
  435. } else {
  436. toastsF(context, "暂无权限,请申请成为专家", timeInSecForIos: 3);
  437. // fToast.showToast(
  438. // child: ClipRRect(
  439. // borderRadius: BorderRadius.circular(50),
  440. // child: Container(
  441. // color: Color(0xffcccccc),
  442. // padding: EdgeInsets.only(left:15,right:15,top:8,bottom:10),
  443. // child: Text(
  444. // "暂无权限,请申请成为专家",
  445. // style: TextStyle(
  446. // fontSize: 13,
  447. // color: Color(0xffffffff),
  448. // ),
  449. // ),
  450. // ),
  451. // )
  452. // ,
  453. // gravity: ToastGravity.BOTTOM,
  454. // toastDuration: Duration(seconds: 3),
  455. // );
  456. }
  457. return;
  458. }
  459. if (SpUtil.getString(Constant.companyId).length == 0) {
  460. showAlert(
  461. context,
  462. "提示",
  463. "尚未加入团队,是否立即加入?",
  464. "确定",
  465. () {
  466. NavigatorUtils.goBack(context);
  467. goToPage(TeamRouter.teamListPage);
  468. },
  469. txt2: "取消",
  470. onPre2: () {
  471. NavigatorUtils.goBack(context);
  472. });
  473. } else {
  474. if (index == 0) {
  475. goToPage(ProjectRouter.projectPage);
  476. } else if (index == 1) {
  477. goToPage(MaintenanceRouter.maintenanceListPage);
  478. } else if (index == 2) {
  479. goToPage(RepairRouter.repairListPage);
  480. } else if (index == 3) {
  481. goToPage(YearlyRouter.yearlyListPage);
  482. } else if (index == 4) {
  483. goToPage(MessageRouter.messageListPage);
  484. } else if (index == 5) {
  485. goToPage(SignRouter.signPage);
  486. } else if (index == 6) {
  487. goToPage(HeavyRouter.heavyListPage);
  488. }
  489. }
  490. }),
  491. Container(
  492. padding: EdgeInsets.only(left: 20, right: 20),
  493. child: const Text("常用工具", style: TextStyles.textBold15),
  494. ),
  495. Gaps.vGap10,
  496. _ToolsItem(
  497. menuTitle2,
  498. menuImage2,
  499. (index) {
  500. if (SpUtil.getString(Constant.companyId).length == 0) {
  501. showAlert(
  502. context,
  503. "提示",
  504. "尚未加入团队,是否立即加入?",
  505. "确定",
  506. () {
  507. NavigatorUtils.goBack(context);
  508. goToPage(TeamRouter.teamSearchPage);
  509. },
  510. txt2: "取消",
  511. onPre2: () {
  512. NavigatorUtils.goBack(context);
  513. });
  514. } else {
  515. if (index == 0) {
  516. goToPage(TeamRouter.teamListPage);
  517. } else if (index == 1) {
  518. goToPage(TeamRouter.teamUserPage);
  519. }
  520. }
  521. },
  522. ),
  523. ],
  524. ),
  525. ),
  526. )
  527. ];
  528. }
  529. }
  530. List<String> menuTitle = [
  531. "项目电梯",
  532. "日常保养",
  533. "紧急召修",
  534. "年度检验",
  535. "消息中心",
  536. "签到打卡",
  537. "大修",
  538. "专家工单"
  539. ];
  540. List<String> menuImage = [
  541. "icon_xmdt",
  542. "icon_rcby",
  543. "icon_jxgl",
  544. "icon_njgl",
  545. "icon_xxzx",
  546. "icon_dkqd",
  547. "icon_dx",
  548. "icon_zjgzt"
  549. ];
  550. List<String> menuTitle2 = ["团队管理", "团队成员"];
  551. List<String> menuImage2 = ["icon_tdgl", "icon_tdmp"];
  552. class _ToolsItem extends StatelessWidget {
  553. _ToolsItem(this.titles, this.imgs, this.onTap, {Key key}) : super(key: key);
  554. List<String> titles;
  555. List<String> imgs;
  556. Function onTap;
  557. @override
  558. Widget build(BuildContext context) {
  559. return GridView.builder(
  560. shrinkWrap: true,
  561. padding: const EdgeInsets.fromLTRB(8.0, 0, 8.0, 8.0),
  562. physics: NeverScrollableScrollPhysics(),
  563. gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
  564. crossAxisCount: 4, childAspectRatio: 1.1, crossAxisSpacing: 2),
  565. itemCount: titles.length,
  566. itemBuilder: (_, index) {
  567. return Stack(
  568. alignment: Alignment.center,
  569. children: [
  570. InkWell(
  571. child: Column(
  572. mainAxisAlignment: MainAxisAlignment.center,
  573. children: <Widget>[
  574. LoadAssetImage(
  575. "work/${imgs[index]}",
  576. width: 38,
  577. height: 38,
  578. ),
  579. Gaps.vGap10,
  580. Text(
  581. titles[index],
  582. style: TextStyles.textSize13,
  583. )
  584. ],
  585. ),
  586. onTap: () {
  587. onTap(index);
  588. }),
  589. Positioned(
  590. right: su.ScreenUtil().setWidth(15),
  591. top: 0,
  592. child: (index == 7 && caseNum > 0)
  593. ? DecoratedBox(
  594. decoration: BoxDecoration(
  595. border: Border.all(color: Colors.red),
  596. // color: Theme.of(context).errorColor,
  597. borderRadius: BorderRadius.circular(11.0),
  598. ),
  599. child: Padding(
  600. padding: const EdgeInsets.symmetric(
  601. horizontal: 5.5, vertical: 2.0),
  602. child: Text(
  603. "$caseNum",
  604. style: TextStyle(
  605. color: Colors.red, fontSize: Dimens.font_sp12),
  606. ),
  607. ),
  608. )
  609. : Gaps.empty,
  610. )
  611. ],
  612. );
  613. },
  614. );
  615. }
  616. }
  617. class SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
  618. final Widget widget;
  619. final double height;
  620. SliverAppBarDelegate(this.widget, this.height);
  621. // minHeight 和 maxHeight 的值设置为相同时,header就不会收缩了
  622. @override
  623. double get minExtent => height;
  624. @override
  625. double get maxExtent => height;
  626. @override
  627. Widget build(
  628. BuildContext context, double shrinkOffset, bool overlapsContent) {
  629. return widget;
  630. }
  631. @override
  632. bool shouldRebuild(SliverAppBarDelegate oldDelegate) {
  633. return true;
  634. }
  635. }
  636. class _TabView extends StatelessWidget {
  637. const _TabView(this.index, this.text, {this.onTap});
  638. final int index;
  639. final String text;
  640. final Function onTap;
  641. @override
  642. Widget build(BuildContext context) {
  643. var imgList = [
  644. // "work/icon_bywc",
  645. "work/icon_byz",
  646. "work/icon_jx",
  647. "work/icon_nj",
  648. "work/icon_dxx",
  649. ];
  650. return Consumer<WorkPageProvider>(
  651. builder: (_, provider, child) {
  652. return InkWell(
  653. onTap: this.onTap,
  654. child: Stack(
  655. children: <Widget>[
  656. Container(
  657. width: 70.0,
  658. padding: const EdgeInsets.symmetric(vertical: 8.0),
  659. child: Column(
  660. crossAxisAlignment: CrossAxisAlignment.center,
  661. children: <Widget>[
  662. LoadAssetImage(
  663. imgList[index],
  664. width: 27.0,
  665. height: 27.0,
  666. ),
  667. Gaps.vGap4,
  668. Text(text)
  669. ],
  670. ),
  671. ),
  672. child
  673. ],
  674. ),
  675. );
  676. },
  677. child: Positioned(
  678. right: 10.0,
  679. child: (index == 0 && countDoingItem.maintain > 0) ||
  680. (index == 1 && countDoingItem.repair > 0) ||
  681. (index == 2 && countDoingItem.inspection > 0) ||
  682. (index == 3 && countDoingItem.capital > 0)
  683. ? DecoratedBox(
  684. decoration: BoxDecoration(
  685. border: Border.all(color: Colors.red),
  686. // color: Theme.of(context).errorColor,
  687. borderRadius: BorderRadius.circular(11.0),
  688. ),
  689. child: Padding(
  690. padding: const EdgeInsets.symmetric(
  691. horizontal: 5.5, vertical: 2.0),
  692. child: Text(
  693. "${index == 0 ? countDoingItem.maintain : index == 1 ? countDoingItem.repair : index == 2 ? countDoingItem.inspection : countDoingItem.capital}",
  694. style: TextStyle(
  695. color: Colors.red, fontSize: Dimens.font_sp12),
  696. ),
  697. ),
  698. )
  699. : Gaps.empty,
  700. ));
  701. }
  702. }