view.dart 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769
  1. import 'package:fis_jsonrpc/rpc.dart';
  2. import 'package:flutter/foundation.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:get/get.dart';
  5. import 'package:intl/intl.dart';
  6. import 'package:vitalapp/architecture/app_parameters.dart';
  7. import 'package:vitalapp/architecture/utils/advance_debounce.dart';
  8. import 'package:vitalapp/architecture/utils/datetime.dart';
  9. import 'package:vitalapp/architecture/utils/prompt_box.dart';
  10. import 'package:vitalapp/architecture/utils/sensitive.dart';
  11. import 'package:vitalapp/architecture/values/features.dart';
  12. import 'package:vitalapp/components/alert_dialog.dart';
  13. import 'package:vitalapp/components/button.dart';
  14. import 'package:vitalapp/components/dialog_date.dart';
  15. import 'package:vitalapp/components/dynamic_drawer.dart';
  16. import 'package:vitalapp/components/input.dart';
  17. import 'package:vitalapp/components/search_input.dart';
  18. import 'package:vitalapp/components/tag_widget.dart';
  19. import 'package:vitalapp/consts/rpc_enum_labels.dart';
  20. import 'package:vitalapp/consts/styles.dart';
  21. import 'package:vitalapp/global.dart';
  22. import 'package:vitalapp/managers/contract/index.dart';
  23. import 'package:vitalapp/managers/interfaces/diagnosis.dart';
  24. import 'package:vitalapp/managers/interfaces/exam.dart';
  25. import 'package:vitalapp/managers/interfaces/models/crowd_labels.dart';
  26. import 'package:vitalapp/managers/interfaces/models/patient_model_dto.dart';
  27. import 'package:vitalapp/pages/home/controller.dart';
  28. import 'package:vitalapp/pages/patient/list/widgets/crowd_select_label.dart';
  29. import 'package:vitalapp/pages/patient/list/widgets/status.dart';
  30. import 'package:vitalapp/pages/widgets/icon_button.dart';
  31. import 'package:vitalapp/store/store.dart';
  32. import 'controller.dart';
  33. class PatientListPage extends GetView<PatientListController> {
  34. const PatientListPage({super.key});
  35. @override
  36. Widget build(BuildContext context) {
  37. return Container(
  38. margin: const EdgeInsets.all(16),
  39. child: Column(
  40. children: [
  41. _HeaderWidget(
  42. onFilterPressed: () {
  43. VDynamicDrawerWrapper.show(
  44. scaffoldKey: Get.find<HomeController>().homeScaffoldKey,
  45. builder: (_) => _filterdrawer(context),
  46. );
  47. // scaffoldKey.currentState?.openEndDrawer();
  48. },
  49. ),
  50. const SizedBox(height: 20),
  51. Expanded(child: _buildListView()),
  52. ],
  53. ),
  54. );
  55. }
  56. VDrawer _filterdrawer(BuildContext context) {
  57. final scrollController = ScrollController();
  58. controller.crowdLabelsController.onReady();
  59. return VDrawer(
  60. width: 600,
  61. title: "筛选",
  62. scaffoldKey: Get.find<HomeController>().homeScaffoldKey,
  63. onConfirm: () {
  64. var state = controller.state;
  65. var startTime = state.startTime.value;
  66. var endTime = state.endTime.value;
  67. if (startTime != null &&
  68. endTime != null &&
  69. endTime.difference(startTime).inSeconds < 0) {
  70. PromptBox.toast('起始时间不能晚于结束时间');
  71. return;
  72. }
  73. controller.reloadList(isFilter: true);
  74. // Get.back();
  75. VDynamicDrawerWrapper.hide(
  76. scaffoldKey: Get.find<HomeController>().homeScaffoldKey,
  77. );
  78. },
  79. onCancel: () {
  80. // Get.back();
  81. VDynamicDrawerWrapper.hide(
  82. scaffoldKey: Get.find<HomeController>().homeScaffoldKey,
  83. );
  84. },
  85. child: Scrollbar(
  86. controller: scrollController,
  87. thumbVisibility: true,
  88. child: SingleChildScrollView(
  89. controller: scrollController,
  90. child: Padding(
  91. padding: const EdgeInsets.symmetric(horizontal: 40, vertical: 20),
  92. child: Column(
  93. crossAxisAlignment: CrossAxisAlignment.start,
  94. children: [
  95. const Text(
  96. '居民创建时间:',
  97. style: TextStyle(fontSize: 20),
  98. ),
  99. const SizedBox(
  100. height: 20,
  101. ),
  102. Row(
  103. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  104. mainAxisSize: MainAxisSize.max,
  105. children: [
  106. Expanded(
  107. child: Obx(
  108. () => VInput(
  109. readOnly: true,
  110. controller: TextEditingController(
  111. text: DateFormat('yyyy-MM-dd').format(
  112. controller.state.startTime.value!.toLocal(),
  113. ),
  114. ),
  115. radius: 4,
  116. onTap: () async {
  117. DateTime? result;
  118. bool _isLocalStation =
  119. AppParameters.data.isLocalStation;
  120. if (kIsWeb || _isLocalStation) {
  121. result = await showDatePicker(
  122. context: Get.context!,
  123. initialDate: controller.state.startTime.value ??
  124. DateTime.now(),
  125. firstDate: DateTime(1900),
  126. lastDate: controller.state.endTime.value ??
  127. DateTime(2100),
  128. );
  129. } else {
  130. result = await VDialogDate(
  131. maxValue: controller.state.endTime.value,
  132. title: '起始时间',
  133. initialValue: controller.state.startTime.value,
  134. ).show();
  135. }
  136. controller.state.startTime.value = result;
  137. },
  138. ),
  139. ),
  140. ),
  141. Container(
  142. margin: const EdgeInsets.symmetric(horizontal: 16),
  143. child: const Text('一')),
  144. Expanded(
  145. child: Obx(
  146. () => VInput(
  147. readOnly: true,
  148. controller: TextEditingController(
  149. text: DateFormat('yyyy-MM-dd').format(
  150. controller.state.endTime.value!.toLocal(),
  151. ),
  152. ),
  153. radius: 4,
  154. onTap: () async {
  155. DateTime? result;
  156. bool _isLocalStation =
  157. AppParameters.data.isLocalStation;
  158. if (kIsWeb || _isLocalStation) {
  159. result = await showDatePicker(
  160. context: Get.context!,
  161. initialDate: controller.state.startTime.value ??
  162. DateTime.now(),
  163. firstDate: DateTime(1900),
  164. lastDate: controller.state.endTime.value ??
  165. DateTime(2100),
  166. );
  167. } else {
  168. result = await VDialogDate(
  169. title: '结束时间',
  170. initialValue: controller.state.endTime.value,
  171. ).show();
  172. }
  173. controller.state.endTime.value = result;
  174. },
  175. ),
  176. ),
  177. )
  178. ],
  179. ),
  180. const SizedBox(
  181. height: 20,
  182. ),
  183. const Text(
  184. '居民查询范围:',
  185. style: TextStyle(fontSize: 20),
  186. ),
  187. const SizedBox(
  188. height: 20,
  189. ),
  190. ScopeEnquiryResidents(
  191. selectRaidoChange: (int value) {
  192. controller.state.selectBoxFilterFounder = value;
  193. },
  194. selectIndex: controller.state.selectBoxFilterFounder,
  195. ),
  196. const SizedBox(
  197. height: 20,
  198. ),
  199. const Text(
  200. '人群分类:',
  201. style: TextStyle(fontSize: 20),
  202. ),
  203. const SizedBox(
  204. height: 20,
  205. ),
  206. CrowdSelectLabelView(
  207. controller: controller.crowdLabelsController,
  208. ),
  209. const SizedBox(
  210. height: 20,
  211. ),
  212. const Text(
  213. '签约状态:',
  214. style: TextStyle(fontSize: 20),
  215. ),
  216. const SizedBox(
  217. height: 20,
  218. ),
  219. ContractStateSelectLabelView(
  220. ContractStateEnums: [
  221. ContractStateEnum.Signed,
  222. ContractStateEnum.Unsigned,
  223. ContractStateEnum.Voided,
  224. ContractStateEnum.Refused,
  225. ],
  226. selectContractState:
  227. controller.state.contractStateSelectedItem,
  228. selectRaidoChange: (String value) {
  229. if (value == "0") {
  230. controller.state.contractStateSelectedItem = null;
  231. return;
  232. }
  233. controller.state.contractStateSelectedItem =
  234. ContractStateEnum.values
  235. .where((element) => element.name == value)
  236. .first;
  237. },
  238. ),
  239. ],
  240. ),
  241. ),
  242. ),
  243. ),
  244. );
  245. }
  246. Widget _buildListView() {
  247. final scrollController = ScrollController();
  248. scrollController.addListener(
  249. () {
  250. // 如果滑动到底部
  251. try {
  252. if (scrollController.position.atEdge) {
  253. if (scrollController.position.pixels != 0) {
  254. if (controller.state.hasNextPage) {
  255. controller.loadNextPageList();
  256. }
  257. }
  258. }
  259. } catch (e) {
  260. // logger.e("listViewScrollController exception:", e);
  261. }
  262. },
  263. );
  264. return RefreshIndicator(
  265. onRefresh: () async {
  266. controller.reloadList();
  267. },
  268. child: Obx(
  269. () {
  270. final list = controller.state.dataList;
  271. final children = <Widget>[];
  272. for (var i = 0; i < list.length; i++) {
  273. children.add(_PatientCard(dto: list[i]));
  274. }
  275. return children.isEmpty
  276. ? Container(
  277. margin: const EdgeInsets.only(top: 80),
  278. child: Column(
  279. children: [
  280. Center(
  281. child: Image.asset(
  282. "assets/images/no_data.png",
  283. width: 300,
  284. height: 300,
  285. fit: BoxFit.cover,
  286. ),
  287. ),
  288. const Text(
  289. "暂无数据,先看看别的吧",
  290. style: TextStyle(fontSize: 18),
  291. ),
  292. ],
  293. ),
  294. )
  295. : Scrollbar(
  296. trackVisibility: true,
  297. controller: scrollController,
  298. child: GridView(
  299. shrinkWrap: true,
  300. controller: scrollController,
  301. gridDelegate:
  302. const SliverGridDelegateWithFixedCrossAxisCount(
  303. crossAxisCount: 3,
  304. mainAxisSpacing: 16,
  305. crossAxisSpacing: 20,
  306. childAspectRatio: 360 / 200,
  307. ),
  308. children: children,
  309. ),
  310. );
  311. },
  312. ),
  313. );
  314. }
  315. }
  316. class _HeaderWidget extends GetView<PatientListController> {
  317. final searchTextEditingController = TextEditingController();
  318. final VoidCallback onFilterPressed;
  319. _HeaderWidget({
  320. required this.onFilterPressed,
  321. });
  322. @override
  323. Widget build(BuildContext context) {
  324. return SizedBox(
  325. height: 76,
  326. child: Row(
  327. children: [
  328. _PatientStatisticWidget(),
  329. if (Store.user.hasFeature(FeatureKeys.FaceRecognition))
  330. VIconButton(
  331. iconData: Icons.sensor_occupied,
  332. textString: '人脸识别',
  333. voidCallback: () {
  334. if (!kIsOnline) {
  335. PromptBox.toast("当前为离线模式,不支持此功能");
  336. return;
  337. }
  338. Debouncer.run(
  339. controller.onFaceIdLoginClicked,
  340. );
  341. },
  342. ),
  343. if (Store.user.hasFeature(FeatureKeys.IdCardPhotoOCR))
  344. VIconButton(
  345. iconData: Icons.perm_contact_cal_rounded,
  346. textString: '拍照识别',
  347. voidCallback: () {
  348. if (!Store.user
  349. .hasFeature(FeatureKeys.IdCardOfflineRecognition)) {
  350. if (!kIsOnline) {
  351. PromptBox.toast("当前为离线模式,不支持此功能");
  352. return;
  353. }
  354. }
  355. Debouncer.run(
  356. controller.onIdCardScanClickedToDetail,
  357. );
  358. },
  359. ),
  360. if (Store.user.hasFeature(FeatureKeys.IDCardReader))
  361. VIconButton(
  362. iconData: Icons.chrome_reader_mode,
  363. textString: '读卡识别',
  364. voidCallback: () {
  365. Debouncer.run(
  366. controller.onReadCardClickedToDetail,
  367. );
  368. },
  369. ),
  370. VIconButton(
  371. iconData: Icons.edit_document,
  372. textString: '手动录入',
  373. voidCallback: () {
  374. Debouncer.run(
  375. controller.onManualInputPatient,
  376. );
  377. },
  378. ),
  379. Expanded(
  380. child: SizedBox(
  381. height: 70,
  382. child: Obx(
  383. () => VSearchInput(
  384. textEditingController: searchTextEditingController,
  385. placeholder:
  386. "身份证号码/姓名${controller.state.isOnline ? '/手机号/地址' : ''}",
  387. clearable: true,
  388. onClear: () {},
  389. onSearch: (value) {
  390. controller.state.searchString = value;
  391. controller.reloadList();
  392. },
  393. ),
  394. ),
  395. ),
  396. ),
  397. const SizedBox(width: 8),
  398. SizedBox(
  399. width: 180,
  400. height: 70,
  401. child: VButton(
  402. onTap: onFilterPressed,
  403. child: Row(
  404. mainAxisAlignment: MainAxisAlignment.center,
  405. children: const [
  406. Icon(Icons.filter_alt, size: 24),
  407. Text("筛选", style: TextStyle(fontSize: 20)),
  408. ],
  409. ),
  410. ),
  411. ),
  412. ],
  413. ),
  414. );
  415. }
  416. }
  417. class _PatientCard extends StatelessWidget {
  418. final PatientModelDTO dto;
  419. const _PatientCard({required this.dto});
  420. @override
  421. Widget build(BuildContext context) {
  422. final body = Stack(
  423. children: [
  424. Container(
  425. padding: const EdgeInsets.symmetric(
  426. horizontal: 16,
  427. vertical: 12,
  428. ),
  429. child: Column(
  430. crossAxisAlignment: CrossAxisAlignment.start,
  431. children: [
  432. const SizedBox(height: 8),
  433. SizedBox(
  434. child: Text(
  435. dto.patientName!,
  436. overflow: TextOverflow.ellipsis,
  437. style: const TextStyle(
  438. color: Colors.black,
  439. fontSize: 26,
  440. fontWeight: FontWeight.bold,
  441. ),
  442. ),
  443. ),
  444. const SizedBox(height: 8),
  445. LayoutBuilder(
  446. builder: (context, c) {
  447. final width = c.maxWidth - 80;
  448. // 不和状态标签重叠,并保持一定距离
  449. return SizedBox(width: width, child: _buildBaseInfoRow());
  450. },
  451. ),
  452. const SizedBox(height: 4),
  453. _buildPhone(),
  454. const SizedBox(height: 4),
  455. _buildCardNo(),
  456. if (Store.user.hasFeature(FeatureKeys.CrowdClassification) &&
  457. (dto.labelNames?.isNotEmpty ?? false)) ...[
  458. const Expanded(child: SizedBox()),
  459. _buildClassTags(),
  460. ],
  461. ],
  462. ),
  463. ),
  464. Positioned(
  465. top: 0,
  466. right: 0,
  467. child: _PatientSignStatusTag(
  468. dto: dto,
  469. ),
  470. ),
  471. if (kIsOnline || dto.isExistLocalData == true)
  472. Positioned(
  473. right: 0,
  474. bottom: 0,
  475. child: _PatientRemoveMarkButton(dto: dto),
  476. ),
  477. ],
  478. );
  479. return Material(
  480. borderRadius: GlobalStyles.borderRadius,
  481. child: Ink(
  482. decoration: BoxDecoration(
  483. color: Colors.white,
  484. borderRadius: GlobalStyles.borderRadius,
  485. border: Border.all(color: Colors.grey.shade400),
  486. ),
  487. child: InkWell(
  488. borderRadius: GlobalStyles.borderRadius,
  489. onTap: () {
  490. // Get.back();
  491. Get.find<PatientListController>().patientListGotoDetail(dto);
  492. },
  493. child: body,
  494. ),
  495. ),
  496. );
  497. }
  498. Widget _buildBaseInfoRow() {
  499. final birthday = dto.birthday!.toLocal();
  500. final age = DataTimeUtils.calculateAge(birthday);
  501. return Row(
  502. mainAxisSize: MainAxisSize.max,
  503. mainAxisAlignment: MainAxisAlignment.spaceBetween,
  504. children: [
  505. Expanded(
  506. child: Row(
  507. mainAxisSize: MainAxisSize.max,
  508. mainAxisAlignment: MainAxisAlignment.start,
  509. children: [
  510. Expanded(
  511. flex: 1,
  512. child: Text(
  513. RpcEnumLabels.gender[dto.patientGender] ?? "未知",
  514. style: const TextStyle(
  515. color: Colors.grey,
  516. fontSize: 20,
  517. fontWeight: FontWeight.bold,
  518. ),
  519. ),
  520. ),
  521. Expanded(
  522. flex: 1,
  523. child: Text(
  524. "$age岁",
  525. style: const TextStyle(
  526. color: Colors.grey,
  527. fontSize: 20,
  528. ),
  529. ),
  530. ),
  531. ],
  532. ),
  533. ),
  534. ],
  535. );
  536. }
  537. Widget _buildClassTags() {
  538. return Column(
  539. children: [
  540. ConstrainedBox(
  541. constraints: const BoxConstraints(
  542. minWidth: double.infinity,
  543. maxHeight: 28,
  544. ),
  545. child: ListView(
  546. controller: ScrollController(),
  547. scrollDirection: Axis.horizontal,
  548. children: [
  549. Row(
  550. children: dto.labelNames!
  551. .map(
  552. (e) => TagWidget(
  553. height: 50,
  554. label: e,
  555. borderColor: (e == CrowdLabels.CHILDREN ||
  556. e == CrowdLabels.ELDERLY)
  557. ? Colors.blue
  558. : Colors.orange,
  559. backgroundColor: Colors.transparent,
  560. textColor: Colors.black,
  561. padding: EdgeInsets.only(
  562. top: 2,
  563. bottom: 2,
  564. right: 8,
  565. left: 4,
  566. ),
  567. ),
  568. )
  569. .toList(),
  570. )
  571. ]),
  572. ),
  573. ],
  574. );
  575. }
  576. Widget _buildPhone() {
  577. if (dto.phone != null && dto.phone!.isNotEmpty) {
  578. String phone = dto.phone!;
  579. if (Store.app.enableEncryptSensitiveInfo) {
  580. phone = SensitiveUtils.desensitizeMobilePhone(phone);
  581. }
  582. return Text(
  583. '手机号:$phone',
  584. style: const TextStyle(color: Colors.grey, fontSize: 18),
  585. );
  586. } else {
  587. return const SizedBox();
  588. }
  589. }
  590. Widget _buildCardNo() {
  591. if (dto.cardNo != null && dto.cardNo!.isNotEmpty) {
  592. String cardNo = dto.cardNo!;
  593. if (Store.app.enableEncryptSensitiveInfo) {
  594. cardNo = SensitiveUtils.desensitizeIdCard(cardNo);
  595. }
  596. return Text(
  597. '证件号码:$cardNo',
  598. style: const TextStyle(color: Colors.grey, fontSize: 18),
  599. );
  600. } else {
  601. return const SizedBox();
  602. }
  603. }
  604. }
  605. class _PatientSignStatusTag extends StatelessWidget {
  606. final PatientModelDTO dto;
  607. _PatientSignStatusTag({required this.dto});
  608. final ContractUtils _contractUtils = ContractUtils();
  609. @override
  610. Widget build(BuildContext context) {
  611. return Container(
  612. alignment: Alignment.centerRight,
  613. width: 120,
  614. padding: const EdgeInsets.only(top: 18),
  615. child: StatusLabel(
  616. title: _contractUtils.dataOfflineStatus(dto.isExistLocalData!),
  617. color: _contractUtils.dataOfflineColor(dto.isExistLocalData!),
  618. ),
  619. );
  620. }
  621. }
  622. class _PatientRemoveMarkButton extends StatelessWidget {
  623. final PatientModelDTO dto;
  624. const _PatientRemoveMarkButton({required this.dto});
  625. @override
  626. Widget build(BuildContext context) {
  627. return GestureDetector(
  628. onTap: () async {
  629. var message = await _getDeleteShowMessage();
  630. Get.dialog(
  631. VAlertDialog(
  632. title: "提示",
  633. width: 300,
  634. content: Container(
  635. height: 64,
  636. padding: const EdgeInsets.symmetric(horizontal: 24),
  637. alignment: Alignment.center,
  638. child: Text(
  639. " “${dto.patientName}$message是否确定删除?",
  640. style: TextStyle(fontSize: 20),
  641. ),
  642. ),
  643. onConfirm: () async {
  644. Get.find<PatientListController>().removePatient(dto.code!);
  645. Get.back();
  646. },
  647. ),
  648. barrierDismissible: false,
  649. barrierColor: Colors.black.withOpacity(.4),
  650. );
  651. },
  652. child: Container(
  653. padding: EdgeInsets.only(top: 10, left: 10, right: 2, bottom: 2),
  654. decoration: BoxDecoration(
  655. color: Colors.red,
  656. borderRadius: BorderRadius.only(
  657. topLeft: Radius.circular(32),
  658. bottomRight: Radius.circular(4),
  659. ),
  660. ),
  661. child: Icon(
  662. Icons.delete_forever,
  663. size: 26,
  664. color: Colors.white,
  665. ),
  666. ),
  667. );
  668. }
  669. Future<String> _getDeleteShowMessage() async {
  670. String message = "";
  671. var diagnosisManager = Get.find<IDiagnosisManager>();
  672. var diagnosisList = await diagnosisManager.getDiagnosisAggregationPageAsync(
  673. dto.code!, 1, 10);
  674. var listRecords = await diagnosisManager.getListByPatientCode(dto.code!);
  675. if ((diagnosisList != null && diagnosisList.dataCount > 0) ||
  676. (listRecords != null && listRecords.length > 0)) {
  677. message += "检测记录";
  678. }
  679. var examManager = Get.find<IExamManager>();
  680. var examList =
  681. await examManager.getPatientExamByPageAsync(dto.code!, "HEITCMC");
  682. if (examList != null && examList.length > 0) {
  683. if (message.length > 0) {
  684. message += "和中医体质记录";
  685. } else {
  686. message += "中医体质记录";
  687. }
  688. }
  689. if (message.length > 0) {
  690. message = "有" + message + ",";
  691. }
  692. return message;
  693. }
  694. }
  695. class _PatientStatisticWidget extends StatelessWidget {
  696. @override
  697. Widget build(BuildContext context) {
  698. final controller = Get.find<PatientListController>();
  699. final state = controller.state;
  700. return Container(
  701. width: 160,
  702. alignment: Alignment.centerLeft,
  703. child: Obx(() {
  704. return Column(
  705. mainAxisAlignment: MainAxisAlignment.center,
  706. crossAxisAlignment: CrossAxisAlignment.start,
  707. children: [
  708. _buildItem(context, "当日建档数量: ", state.statisticTodayCount),
  709. const SizedBox(height: 8),
  710. _buildItem(context, "总共建档数量: ", state.statisticTotalCount),
  711. const SizedBox(height: 8),
  712. _buildItem(context, "查询结果数量: ", state.queryResultTotalCount),
  713. ],
  714. );
  715. }),
  716. );
  717. }
  718. Widget _buildItem(BuildContext context, String label, int count) {
  719. return Expanded(
  720. child: RichText(
  721. text: TextSpan(
  722. style: TextStyle(
  723. fontSize: 16,
  724. color: Colors.black,
  725. fontFamily: "NotoSansSC",
  726. fontFamilyFallback: const ["NotoSansSC"],
  727. ),
  728. children: [
  729. TextSpan(text: label),
  730. TextSpan(text: " "),
  731. TextSpan(
  732. text: "${count}",
  733. style: TextStyle(
  734. fontSize: 16,
  735. color: Theme.of(context).primaryColor,
  736. ),
  737. ),
  738. ],
  739. ),
  740. ),
  741. );
  742. }
  743. }