浏览代码

修改版本号v0.0.4; 增加库存任务单详情页;

maqiang 1 年之前
父节点
当前提交
57b5158770

+ 171 - 0
assets/json/China.json

@@ -0,0 +1,171 @@
1
+[{  
2
+    "ProID": 1,  
3
+    "name": "北京市",  
4
+    "ProSort": 1,  
5
+    "ProRemark": "直辖市"  
6
+}, {  
7
+    "ProID": 2,  
8
+    "name": "天津市",  
9
+    "ProSort": 2,  
10
+    "ProRemark": "直辖市"  
11
+}, {  
12
+    "ProID": 3,  
13
+    "name": "河北省",  
14
+    "ProSort": 5,  
15
+    "ProRemark": "省份"  
16
+}, {  
17
+    "ProID": 4,  
18
+    "name": "山西省",  
19
+    "ProSort": 6,  
20
+    "ProRemark": "省份"  
21
+}, {  
22
+    "ProID": 5,  
23
+    "name": "内蒙古自治区",  
24
+    "ProSort": 32,  
25
+    "ProRemark": "自治区"  
26
+}, {  
27
+    "ProID": 6,  
28
+    "name": "辽宁省",  
29
+    "ProSort": 8,  
30
+    "ProRemark": "省份"  
31
+}, {  
32
+    "ProID": 7,  
33
+    "name": "吉林省",  
34
+    "ProSort": 9,  
35
+    "ProRemark": "省份"  
36
+}, {  
37
+    "ProID": 8,  
38
+    "name": "黑龙江省",  
39
+    "ProSort": 10,  
40
+    "ProRemark": "省份"  
41
+}, {  
42
+    "ProID": 9,  
43
+    "name": "上海市",  
44
+    "ProSort": 3,  
45
+    "ProRemark": "直辖市"  
46
+}, {  
47
+    "ProID": 10,  
48
+    "name": "江苏省",  
49
+    "ProSort": 11,  
50
+    "ProRemark": "省份"  
51
+}, {  
52
+    "ProID": 11,  
53
+    "name": "浙江省",  
54
+    "ProSort": 12,  
55
+    "ProRemark": "省份"  
56
+}, {  
57
+    "ProID": 12,  
58
+    "name": "安徽省",  
59
+    "ProSort": 13,  
60
+    "ProRemark": "省份"  
61
+}, {  
62
+    "ProID": 13,  
63
+    "name": "福建省",  
64
+    "ProSort": 14,  
65
+    "ProRemark": "省份"  
66
+}, {  
67
+    "ProID": 14,  
68
+    "name": "江西省",  
69
+    "ProSort": 15,  
70
+    "ProRemark": "省份"  
71
+}, {  
72
+    "ProID": 15,  
73
+    "name": "山东省",  
74
+    "ProSort": 16,  
75
+    "ProRemark": "省份"  
76
+}, {  
77
+    "ProID": 16,  
78
+    "name": "河南省",  
79
+    "ProSort": 17,  
80
+    "ProRemark": "省份"  
81
+}, {  
82
+    "ProID": 17,  
83
+    "name": "湖北省",  
84
+    "ProSort": 18,  
85
+    "ProRemark": "省份"  
86
+}, {  
87
+    "ProID": 18,  
88
+    "name": "湖南省",  
89
+    "ProSort": 19,  
90
+    "ProRemark": "省份"  
91
+}, {  
92
+    "ProID": 19,  
93
+    "name": "广东省",  
94
+    "ProSort": 20,  
95
+    "ProRemark": "省份"  
96
+}, {  
97
+    "ProID": 20,  
98
+    "name": "海南省",  
99
+    "ProSort": 24,  
100
+    "ProRemark": "省份"  
101
+}, {  
102
+    "ProID": 21,  
103
+    "name": "广西壮族自治区",  
104
+    "ProSort": 28,  
105
+    "ProRemark": "自治区"  
106
+}, {  
107
+    "ProID": 22,  
108
+    "name": "甘肃省",  
109
+    "ProSort": 21,  
110
+    "ProRemark": "省份"  
111
+}, {  
112
+    "ProID": 23,  
113
+    "name": "陕西省",  
114
+    "ProSort": 27,  
115
+    "ProRemark": "省份"  
116
+}, {  
117
+    "ProID": 24,  
118
+    "name": "新 疆维吾尔自治区",  
119
+    "ProSort": 31,  
120
+    "ProRemark": "自治区"  
121
+}, {  
122
+    "ProID": 25,  
123
+    "name": "青海省",  
124
+    "ProSort": 26,  
125
+    "ProRemark": "省份"  
126
+}, {  
127
+    "ProID": 26,  
128
+    "name": "宁夏回族自治区",  
129
+    "ProSort": 30,  
130
+    "ProRemark": "自治区"  
131
+}, {  
132
+    "ProID": 27,  
133
+    "name": "重庆市",  
134
+    "ProSort": 4,  
135
+    "ProRemark": "直辖市"  
136
+}, {  
137
+    "ProID": 28,  
138
+    "name": "四川省",  
139
+    "ProSort": 22,  
140
+    "ProRemark": "省份"  
141
+}, {  
142
+    "ProID": 29,  
143
+    "name": "贵州省",  
144
+    "ProSort": 23,  
145
+    "ProRemark": "省份"  
146
+}, {  
147
+    "ProID": 30,  
148
+    "name": "云南省",  
149
+    "ProSort": 25,  
150
+    "ProRemark": "省份"  
151
+}, {  
152
+    "ProID": 31,  
153
+    "name": "西藏自治区",  
154
+    "ProSort": 29,  
155
+    "ProRemark": "自治区"  
156
+}, {  
157
+    "ProID": 32,  
158
+    "name": "台湾省",  
159
+    "ProSort": 7,  
160
+    "ProRemark": "省份"  
161
+}, {  
162
+    "ProID": 33,  
163
+    "name": "澳门特别行政区",  
164
+    "ProSort": 33,  
165
+    "ProRemark": "特别行政区"  
166
+}, {  
167
+    "ProID": 34,  
168
+    "name": "香港特别行政区",  
169
+    "ProSort": 34,  
170
+    "ProRemark": "特别行政区"  
171
+}]  

+ 233 - 0
assets/json/shijie.json

@@ -0,0 +1,233 @@
1
+{
2
+  "China": "中国",
3
+  "Afghanistan": "阿富汗",
4
+  "Aland Islands": "奥兰群岛",
5
+  "Albania": "阿尔巴尼亚",
6
+  "Algeria": "阿尔及利亚",
7
+  "American Samoa": "美属萨摩亚",
8
+  "Andorra": "安道尔",
9
+  "Angola": "安哥拉",
10
+  "Anguilla": "安圭拉",
11
+  "Antigua and Barbuda": "安提瓜和巴布达",
12
+  "Argentina": "阿根廷",
13
+  "Armenia": "亚美尼亚",
14
+  "Aruba": "阿鲁巴",
15
+  "Australia": "澳大利亚",
16
+  "Austria": "奥地利",
17
+  "Azerbaijan": "阿塞拜疆",
18
+  "Bangladesh": "孟加拉",
19
+  "Bahrain": "巴林",
20
+  "Bahamas": "巴哈马",
21
+  "Barbados": "巴巴多斯",
22
+  "Belarus": "白俄罗斯",
23
+  "Belgium": "比利时",
24
+  "Belize": "伯利兹",
25
+  "Benin": "贝宁",
26
+  "Bermuda": "百慕大",
27
+  "Bhutan": "不丹",
28
+  "Bolivia": "玻利维亚",
29
+  "Bosnia and Herzegovina": "波斯尼亚和黑塞哥维那",
30
+  "Botswana": "博茨瓦纳",
31
+  "Bouvet Island": "布维岛",
32
+  "Brazil": "巴西",
33
+  "Brunei": "文莱",
34
+  "Bulgaria": "保加利亚",
35
+  "Burkina Faso": "布基纳法索",
36
+  "Burundi": "布隆迪",
37
+  "Cambodia": "柬埔寨",
38
+  "Cameroon": "喀麦隆",
39
+  "Canada": "加拿大",
40
+  "Cape Verde": "佛得角",
41
+  "Central African Republic": "中非",
42
+  "Chad": "乍得",
43
+  "Chile": "智利",
44
+  "Christmas Islands": "圣诞岛",
45
+  "Cocos (keeling) Islands": "科科斯(基林)群岛",
46
+  "Colombia": "哥伦比亚",
47
+  "Comoros": "科摩罗",
48
+  "Congo (Congo-Kinshasa)": "刚果(金)",
49
+  "Congo": "刚果",
50
+  "Cook Islands": "库克群岛",
51
+  "Costa Rica": "哥斯达黎加",
52
+  "Cote D’Ivoire": "科特迪瓦",
53
+
54
+  "Croatia": "克罗地亚",
55
+  "Cuba": "古巴",
56
+  "Czech": "捷克",
57
+  "Cyprus": "塞浦路斯",
58
+  "Denmark": "丹麦",
59
+  "Djibouti": "吉布提",
60
+  "Dominica": "多米尼加",
61
+  "East Timor": "东帝汶",
62
+  "Ecuador": "厄瓜多尔",
63
+  "Egypt": "埃及",
64
+  "Equatorial Guinea": "赤道几内亚",
65
+  "Eritrea": "厄立特里亚",
66
+  "Estonia": "爱沙尼亚",
67
+  "Ethiopia": "埃塞俄比亚",
68
+  "Faroe Islands": "法罗群岛",
69
+  "Fiji": "斐济",
70
+  "Finland": "Finland",
71
+  "France": "法国",
72
+  "Franch Metropolitan": "法国大都会",
73
+  "Franch Guiana": "法属圭亚那",
74
+  "French Polynesia": "法属波利尼西亚",
75
+  "Gabon": "加蓬",
76
+  "Gambia": "冈比亚",
77
+  "Georgia": "格鲁吉亚",
78
+  "Germany": "德国",
79
+  "Ghana": "加纳",
80
+  "Gibraltar": "直布罗陀",
81
+  "Greece": "希腊",
82
+  "Grenada": "格林纳达",
83
+  "Guadeloupe": "瓜德罗普岛",
84
+  "Guam": "关岛",
85
+  "Guatemala": "危地马拉",
86
+  "Guernsey": "根西岛",
87
+  "Guinea-Bissau": "几内亚比绍",
88
+  "Guinea": "几内亚",
89
+  "Guyana": "圭亚那",
90
+
91
+  "Haiti": "海地",
92
+  "Honduras": "洪都拉斯",
93
+  "Hungary": "匈牙利",
94
+  "Iceland": "冰岛",
95
+  "India": "印度",
96
+  "Indonesia": "印度尼西亚",
97
+  "Iran": "伊朗",
98
+  "Iraq": "伊拉克",
99
+  "Ireland": "爱尔兰",
100
+  "Isle of Man": "马恩岛",
101
+  "Israel": "以色列",
102
+  "Italy": "意大利",
103
+  "Jamaica": "牙买加",
104
+  "Japan": "日本",
105
+  "Jersey": "泽西岛",
106
+  "Jordan": "约旦",
107
+  "Kazakhstan": "哈萨克斯坦",
108
+  "Kenya": "肯尼亚",
109
+  "Kiribati": "基里巴斯",
110
+  "Korea (South)": "韩国",
111
+  "Korea (North)": "朝鲜",
112
+  "Kuwait": "科威特",
113
+  "Kyrgyzstan": "吉尔吉斯斯坦",
114
+  "Laos": "老挝",
115
+  "Latvia": "拉脱维亚",
116
+  "Lebanon": "黎巴嫩",
117
+  "Lesotho": "莱索托",
118
+  "Liberia": "利比里亚",
119
+  "Libya": "利比亚",
120
+  "Liechtenstein": "列支敦士登",
121
+  "Lithuania": "立陶宛",
122
+  "Luxembourg": "卢森堡",
123
+
124
+  "Macedonia": "马其顿",
125
+  "Malawi": "马拉维",
126
+  "Malaysia": "马来西亚",
127
+  "Madagascar": "马达加斯加",
128
+  "Maldives": "马尔代夫",
129
+  "Mali": "马里",
130
+  "Malta": "马耳他",
131
+  "Marshall Islands": "马绍尔群岛",
132
+  "Martinique": "马提尼克岛",
133
+  "Mauritania": "毛里塔尼亚",
134
+  "Mauritius": "毛里求斯",
135
+  "Mayotte": "马约特",
136
+  "Mexico": "墨西哥",
137
+  "Micronesia": "密克罗尼西亚",
138
+  "Moldova": "摩尔多瓦",
139
+  "Monaco": "摩纳哥",
140
+  "Mongolia": "蒙古",
141
+  "Montenegro": "黑山",
142
+  "Montserrat": "蒙特塞拉特",
143
+  "Morocco": "摩洛哥",
144
+  "Mozambique": "莫桑比克",
145
+  "Myanmar": "缅甸",
146
+  "Namibia": "纳米比亚",
147
+  "Nauru": "瑙鲁",
148
+  "Nepal": "尼泊尔",
149
+  "Netherlands": "荷兰",
150
+  "New Caledonia": "新喀里多尼亚",
151
+  "New Zealand": "新西兰",
152
+  "Nicaragua": "尼加拉瓜",
153
+  "Niger": "尼日尔",
154
+  "Nigeria": "尼日利亚",
155
+  "Niue": "纽埃",
156
+  "Norfolk Island": "诺福克岛",
157
+  "Norway": "挪威",
158
+  "Oman": "阿曼",
159
+  "Pakistan": "巴基斯坦",
160
+  "Palau": "帕劳",
161
+  "Palestine": "巴勒斯坦",
162
+  "Panama": "巴拿马",
163
+  "Papua New Guinea": "巴布亚新几内亚",
164
+  "Paraguay": "巴拉圭",
165
+  "Peru": "秘鲁",
166
+  "Philippines": "菲律宾",
167
+  "Pitcairn Islands": "皮特凯恩群岛",
168
+  "Poland": "波兰",
169
+  "Portugal": "葡萄牙",
170
+  "Puerto Rico": "波多黎各",
171
+  "Qatar": "卡塔尔",
172
+  "Reunion": "留尼汪岛",
173
+  "Romania": "罗马尼亚",
174
+  "Rwanda": "卢旺达",
175
+  "Russian Federation": "俄罗斯联邦",
176
+  "Saint Helena": "圣赫勒拿",
177
+  "Saint Kitts-Nevis": "圣基茨和尼维斯",
178
+  "Saint Lucia": "圣卢西亚",
179
+  "Saint Vincent and the Grenadines": "圣文森特和格林纳丁斯",
180
+  "El Salvador": "萨尔瓦多",
181
+  "Samoa": "萨摩亚",
182
+  "San Marino": "圣马力诺",
183
+  "Sao Tome and Principe": "圣多美和普林西比",
184
+  "Saudi Arabia": "沙特阿拉伯",
185
+  "Senegal": "塞内加尔",
186
+  "Seychelles": "塞舌尔",
187
+  "Sierra Leone": "塞拉利昂",
188
+  "Singapore": "新加坡",
189
+  "Serbia": "塞尔维亚",
190
+  "Slovakia": "斯洛伐克",
191
+  "Slovenia": "斯洛文尼亚",
192
+  "Solomon Islands": "所罗门群岛",
193
+  "Somalia": "索马里",
194
+  "South Africa": "南非",
195
+  "Spain": "西班牙",
196
+  "Sri Lanka": "斯里兰卡",
197
+  "Sudan": "苏丹",
198
+  "Suriname": "苏里南",
199
+  "Swaziland": "斯威士兰",
200
+  "Sweden": "瑞典",
201
+  "Switzerland": "瑞士",
202
+  "Syria": "叙利亚",
203
+  "Tajikistan": "塔吉克斯坦",
204
+  "Tanzania": "坦桑尼亚",
205
+
206
+  "Thailand": "泰国",
207
+  "Trinidad and Tobago": "特立尼达和多巴哥",
208
+  "Timor-Leste": "东帝汶",
209
+  "Togo": "多哥",
210
+  "Tokelau": "托克劳",
211
+  "Tonga": "汤加",
212
+  "Tunisia": "突尼斯",
213
+  "Turkey": "土耳其",
214
+  "Turkmenistan": "土库曼斯坦",
215
+  "Tuvalu": "图瓦卢",
216
+  "Uganda": "乌干达",
217
+  "Ukraine": "乌克兰",
218
+  "United Arab Emirates": "阿拉伯联合酋长国",
219
+  "United Kingdom": "英国",
220
+  "United States": "美国",
221
+  "Uruguay": "乌拉圭",
222
+  "Uzbekistan": "乌兹别克斯坦",
223
+  "Vanuatu": "瓦努阿图",
224
+  "Vatican City": "梵蒂冈",
225
+  "Venezuela": "委内瑞拉",
226
+  "Vietnam": "越南",
227
+  "Wallis and Futuna": "瓦利斯群岛和富图纳群岛",
228
+  "Western Sahara": "西撒哈拉",
229
+  "Yemen": "也门",
230
+  "Yugoslavia": "南斯拉夫",
231
+  "Zambia": "赞比亚",
232
+  "Zimbabwe": "津巴布韦"
233
+}

+ 1 - 1
lib/model/rsp/sample_task_rsp.dart

@@ -559,7 +559,7 @@ class SampleTaskItemKcjcRsp {
559 559
   String? dwmc;
560 560
 
561 561
   /// 采样品种名称
562
-  String? cypzmc;
562
+  num? cypzmc;
563 563
 
564 564
   /// 采样品种名称
565 565
   String? cypzName;

+ 1 - 1
lib/network/api.dart

@@ -12,7 +12,7 @@ import '../model/rsp/district_rsp.dart';
12 12
 
13 13
 part 'api.g.dart';
14 14
 
15
-@RestApi(baseUrl: 'http://121.36.17.6:49099')
15
+@RestApi()
16 16
 abstract class Api {
17 17
   factory Api({Dio? dio, String? baseUrl}) {
18 18
     dio ??= BaseDio.get().dio;

+ 7 - 23
lib/page/sample_task/reap_sample_task/reap_sample_task_page.dart

@@ -1,7 +1,6 @@
1 1
 import 'package:flutter/material.dart';
2 2
 import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
3 3
 import 'package:lszlgl/base/base_lifecycle_state.dart';
4
-import 'package:lszlgl/base/base_state.dart';
5 4
 import 'package:lszlgl/config/colors.dart';
6 5
 import 'package:lszlgl/model/rsp/sample_task_rsp.dart';
7 6
 import 'package:lszlgl/page/sample_task/reap_sample_detail/reap_sample_basic_detail_page.dart';
@@ -107,28 +106,13 @@ class _ReapSampleTaskPageState extends BaseLifecycleState<ReapSampleTaskPage> wi
107 106
   }
108 107
 
109 108
   void cratePageList(SampleTaskItem data) {
110
-    if (args.detail) {
111
-      pageList = [
112
-        ReapSampleBasicDetailPage(data),
113
-        ReapSampleVarietyDetailPage(data),
114
-        ReapSampleDisasterDetailPage(data),
115
-        ReapSampleMedicineDetailPage(data),
116
-        ReapSampleOrgDetailPage(data),
117
-      ];
118
-    } else {
119
-      pageList = [
120
-        // ReapSampleBasicPage(nextCallback: next),
121
-        // ReapSampleVarietyPage(nextCallback: next, previousCallback: previous),
122
-        // ReapSampleDisasterPage(nextCallback: next, previousCallback: previous),
123
-        // ReapSampleMedicinePage(nextCallback: next, previousCallback: previous),
124
-        // ReapSampleOrgPage(previousCallback: previous, submitCallback: submit),
125
-        ReapSampleBasicDetailPage(data, detail: false),
126
-        ReapSampleVarietyDetailPage(data, detail: false),
127
-        ReapSampleDisasterDetailPage(data, detail: false),
128
-        ReapSampleMedicineDetailPage(data, detail: false),
129
-        ReapSampleOrgDetailPage(data, detail: false),
130
-      ];
131
-    }
109
+    pageList = [
110
+      ReapSampleBasicDetailPage(data, detail: args.detail),
111
+      ReapSampleVarietyDetailPage(data, detail: args.detail),
112
+      ReapSampleDisasterDetailPage(data, detail: args.detail),
113
+      ReapSampleMedicineDetailPage(data, detail: args.detail),
114
+      ReapSampleOrgDetailPage(data, detail: args.detail),
115
+    ];
132 116
   }
133 117
 
134 118
   @override

+ 3 - 13
lib/page/sample_task/reap_sample_detail/reap_sample_variety_detail_page.dart

@@ -1,5 +1,4 @@
1 1
 import 'package:flutter/material.dart';
2
-import 'package:flutter/services.dart';
3 2
 import 'package:lszlgl/base/base_lifecycle_state.dart';
4 3
 import 'package:lszlgl/service/dict_service.dart';
5 4
 import 'package:lszlgl/utils/string_utils.dart';
@@ -26,8 +25,7 @@ class ReapSampleVarietyDetailPage extends StatefulWidget {
26 25
   State<ReapSampleVarietyDetailPage> createState() => _ReapSampleVarietyDetailPageState();
27 26
 }
28 27
 
29
-class _ReapSampleVarietyDetailPageState extends BaseLifecycleState<ReapSampleVarietyDetailPage>
30
-    with AutomaticKeepAliveClientMixin {
28
+class _ReapSampleVarietyDetailPageState extends BaseLifecycleState<ReapSampleVarietyDetailPage> with AutomaticKeepAliveClientMixin {
31 29
   SampleTaskItem? data;
32 30
   late bool isDetail;
33 31
   late Widget arrowDown;
@@ -152,21 +150,13 @@ class _ReapSampleVarietyDetailPageState extends BaseLifecycleState<ReapSampleVar
152 150
           isDetail,
153 151
           '收获时间',
154 152
           shsj,
155
-          onResult: (value) {
156
-            var date = DateTimeUtils.yyyymmdd(date: value);
157
-            shsj.value = date;
158
-            data?.shsj = date;
159
-          },
153
+          onResult: (value) => data?.shsj = DateTimeUtils.yyyymmdd(date: value),
160 154
         ),
161 155
         CardWidgets.buildDate(
162 156
           isDetail,
163 157
           '扦样时间',
164 158
           qysj,
165
-          onResult: (value) {
166
-            var date = DateTimeUtils.yyyymmdd(date: value);
167
-            qysj.value = date;
168
-            data?.qysj = date;
169
-          },
159
+          onResult: (value) => data?.qysj = DateTimeUtils.yyyymmdd(date: value),
170 160
         ),
171 161
         CardWidgets.buildEdit(
172 162
           isDetail,

+ 0 - 220
lib/page/sample_task/reap_sample_task/reap_sample_basic_page.dart

@@ -1,220 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-import 'package:lszlgl/base/base_state.dart';
3
-import 'package:lszlgl/widget/button.dart';
4
-import 'package:lszlgl/widget/card_item.dart';
5
-
6
-import '../../../config/colors.dart';
7
-
8
-/// 收获扦样-基础信息
9
-class ReapSampleBasicPage extends StatefulWidget {
10
-  final VoidCallback nextCallback;
11
-
12
-  const ReapSampleBasicPage({
13
-    super.key,
14
-    required this.nextCallback,
15
-  });
16
-
17
-  @override
18
-  State<ReapSampleBasicPage> createState() => _ReapSampleBasicPageState();
19
-}
20
-
21
-class _ReapSampleBasicPageState extends BaseState<ReapSampleBasicPage> with AutomaticKeepAliveClientMixin {
22
-  late Widget arrowDown;
23
-
24
-  ValueNotifier<String?> sf = ValueNotifier(null);
25
-  ValueNotifier<String?> sq = ValueNotifier(null);
26
-  ValueNotifier<String?> qx = ValueNotifier(null);
27
-  ValueNotifier<String?> xz = ValueNotifier(null);
28
-  ValueNotifier<String?> cz = ValueNotifier(null);
29
-  ValueNotifier<String?> dllx = ValueNotifier(null);
30
-
31
-  @override
32
-  void initState() {
33
-    super.initState();
34
-    arrowDown = Image.asset(imgItemArrowDown, width: 20);
35
-  }
36
-
37
-  @override
38
-  bool get wantKeepAlive => true;
39
-
40
-  @override
41
-  Widget build(BuildContext context) {
42
-    super.build(context);
43
-    return Column(
44
-      children: [
45
-        Expanded(child: SingleChildScrollView(child: buildList())),
46
-        buildButton(),
47
-      ],
48
-    );
49
-  }
50
-
51
-  Widget buildList() {
52
-    return Column(
53
-      children: [
54
-        CardItemWidget(
55
-          '扦样任务单号',
56
-          rightText: '自动生成',
57
-          bottomLine: true,
58
-        ),
59
-        CardItemWidget(
60
-          '扦样单位',
61
-          rightText: '自动生成',
62
-          bottomLine: true,
63
-        ),
64
-        CardItemWidget(
65
-          '扦样人员',
66
-          rightText: '自动生成',
67
-          bottomLine: true,
68
-        ),
69
-        CardItemWidget(
70
-          '任务类型',
71
-          rightText: '自动生成',
72
-          bottomLine: true,
73
-        ),
74
-        CardItemWidget(
75
-          '省份选择',
76
-          rightChild: buildMenu(sf),
77
-          bottomLine: true,
78
-        ),
79
-        CardItemWidget(
80
-          '市区选择',
81
-          rightChild: buildMenu(sq),
82
-          bottomLine: true,
83
-        ),
84
-        CardItemWidget(
85
-          '区县选择',
86
-          rightChild: buildMenu(qx),
87
-          bottomLine: true,
88
-        ),
89
-        CardItemWidget(
90
-          '乡镇选择',
91
-          rightChild: buildMenu(xz),
92
-          bottomLine: true,
93
-        ),
94
-        CardItemWidget(
95
-          '村选择',
96
-          rightChild: buildMenu(cz),
97
-          bottomLine: true,
98
-        ),
99
-        CardItemWidget(
100
-          '扦样地点经纬度',
101
-          rightText: '',
102
-          hint: '点击获取',
103
-          bottomLine: true,
104
-        ),
105
-        CardItemWidget(
106
-          '种植面积(亩地)',
107
-          rightChild: buildField(hint: '点击填写'),
108
-          bottomLine: true,
109
-        ),
110
-        CardItemWidget(
111
-          '土壤地理类型',
112
-          rightChild: buildMenu(dllx),
113
-          bottomLine: true,
114
-        ),
115
-        CardItemWidget(
116
-          '被调查农户或合作社',
117
-          rightChild: buildField(hint: '点击填写'),
118
-          bottomLine: true,
119
-        ),
120
-        CardItemWidget(
121
-          '联系方式',
122
-          rightChild: buildField(hint: '点击填写'),
123
-          bottomLine: true,
124
-        ),
125
-      ],
126
-    );
127
-  }
128
-
129
-  Widget buildButton() {
130
-    return Container(
131
-      color: const Color(0xFFF1F7F6),
132
-      padding: const EdgeInsets.all(12),
133
-      child: MyButton(
134
-        '下一步',
135
-        onTap: widget.nextCallback,
136
-      ),
137
-    );
138
-  }
139
-
140
-  Widget buildField({String? hint, TextInputType? inputType}) {
141
-    return TextField(
142
-      keyboardType: inputType,
143
-      textAlign: TextAlign.right,
144
-      decoration: InputDecoration(
145
-        hintText: hint,
146
-        border: InputBorder.none,
147
-        contentPadding: EdgeInsets.zero,
148
-        isDense: true,
149
-      ),
150
-      style: const TextStyle(fontSize: 14),
151
-      textInputAction: TextInputAction.next,
152
-      inputFormatters: [],
153
-    );
154
-  }
155
-
156
-  Widget buildMenu(ValueNotifier<String?> notifier) {
157
-    return ValueListenableBuilder(
158
-      valueListenable: notifier,
159
-      builder: (_, value, __) {
160
-        return MenuAnchor(
161
-          style: const MenuStyle(
162
-            padding: MaterialStatePropertyAll(EdgeInsets.zero),
163
-            alignment: Alignment.bottomRight,
164
-          ),
165
-          builder: (_, ctrl, __) => buildMenuText(ctrl, value ?? ''),
166
-          menuChildren: ['选项一', '选项二', '选项三', '选项四']
167
-              .map(
168
-                (e) => buildMenuItem(e, notifier),
169
-              )
170
-              .toList(),
171
-        );
172
-      },
173
-    );
174
-  }
175
-
176
-  Widget buildMenuText(MenuController ctrl, String value) {
177
-    return GestureDetector(
178
-      behavior: HitTestBehavior.opaque,
179
-      onTap: () {
180
-        if (ctrl.isOpen) {
181
-          ctrl.close();
182
-        } else {
183
-          ctrl.open();
184
-        }
185
-      },
186
-      child: Row(
187
-        mainAxisSize: MainAxisSize.min,
188
-        children: [
189
-          Expanded(
190
-            child: Text(
191
-              value,
192
-              textAlign: TextAlign.right,
193
-              style: const TextStyle(
194
-                color: Color(0xFF01B2C8),
195
-                fontSize: 14,
196
-                fontWeight: FontWeight.w500,
197
-              ),
198
-            ),
199
-          ),
200
-          const SizedBox(width: 8),
201
-          arrowDown,
202
-        ],
203
-      ),
204
-    );
205
-  }
206
-
207
-  Widget buildMenuItem(String item, ValueNotifier<String?> notifier) {
208
-    return MenuItemButton(
209
-      child: Container(
210
-        constraints: const BoxConstraints(minWidth: 120),
211
-        alignment: Alignment.center,
212
-        child: Text(
213
-          item,
214
-          style: TextStyle(color: item == notifier.value ? const Color(0xFF01B2C8) : MyColor.c_666666),
215
-        ),
216
-      ),
217
-      onPressed: () => notifier.value = item,
218
-    );
219
-  }
220
-}

+ 0 - 157
lib/page/sample_task/reap_sample_task/reap_sample_disaster_page.dart

@@ -1,157 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-import 'package:lszlgl/base/base_state.dart';
3
-import 'package:lszlgl/widget/card_item.dart';
4
-
5
-/// 收获扦样-灾害污染
6
-class ReapSampleDisasterPage extends StatefulWidget {
7
-  final VoidCallback nextCallback;
8
-  final VoidCallback previousCallback;
9
-
10
-  const ReapSampleDisasterPage({
11
-    super.key,
12
-    required this.nextCallback,
13
-    required this.previousCallback,
14
-  });
15
-
16
-  @override
17
-  State<ReapSampleDisasterPage> createState() => _ReapSampleDisasterPageState();
18
-}
19
-
20
-class _ReapSampleDisasterPageState extends BaseState<ReapSampleDisasterPage> with AutomaticKeepAliveClientMixin {
21
-  late Widget arrowDown;
22
-
23
-  // 工厂排污
24
-  ValueNotifier<bool> gcpw = ValueNotifier(false);
25
-
26
-  // 水源污染
27
-  ValueNotifier<bool> sywr = ValueNotifier(false);
28
-
29
-  // 病虫害
30
-  ValueNotifier<bool> bch = ValueNotifier(false);
31
-
32
-  // 阴雨天气
33
-  ValueNotifier<bool> yytq = ValueNotifier(false);
34
-
35
-  // 水分偏高
36
-  ValueNotifier<bool> sfpg = ValueNotifier(false);
37
-
38
-  // 真菌污染
39
-  ValueNotifier<bool> zjwr = ValueNotifier(false);
40
-
41
-  // 金属污染
42
-  ValueNotifier<bool> jswr = ValueNotifier(false);
43
-
44
-  ValueNotifier<String?> pwlx = ValueNotifier(null);
45
-  ValueNotifier<String?> wrlx = ValueNotifier(null);
46
-  ValueNotifier<String?> bchlx = ValueNotifier(null);
47
-  ValueNotifier<String?> zjlx = ValueNotifier(null);
48
-  ValueNotifier<String?> jslx = ValueNotifier(null);
49
-
50
-  @override
51
-  void initState() {
52
-    super.initState();
53
-    arrowDown = Image.asset(imgItemArrowDown, width: 20);
54
-  }
55
-
56
-  @override
57
-  bool get wantKeepAlive => true;
58
-
59
-  @override
60
-  Widget build(BuildContext context) {
61
-    super.build(context);
62
-    return SingleChildScrollView(child: buildList());
63
-  }
64
-
65
-  Widget buildList() {
66
-    return Column(
67
-      children: [
68
-        CardItemWidget('种植土地周围是否有工厂排污', rightChild: buildSwitch(gcpw), bottomLine: true),
69
-        CardItemWidget('工厂排污类型', rightChild: buildMenu(pwlx), bottomLine: true),
70
-        CardItemWidget('种植土地周围使用水源、土壤是否有污染', rightChild: buildSwitch(sywr), bottomLine: true),
71
-        CardItemWidget('污染物类型', rightChild: buildMenu(wrlx), bottomLine: true),
72
-        CardItemWidget('生产过程中是否发生比较严重的病虫害', rightChild: buildSwitch(bch), bottomLine: true),
73
-        CardItemWidget('病虫害类型', rightChild: buildMenu(bchlx), bottomLine: true),
74
-        CardItemWidget('收货期间是否发生连阴雨天气', rightChild: buildSwitch(yytq), bottomLine: true),
75
-        CardItemWidget('收货粮食水分是否偏高', rightChild: buildSwitch(sfpg), bottomLine: true),
76
-        CardItemWidget('近年来本地是否发生真菌毒素污染', rightChild: buildSwitch(zjwr), bottomLine: true),
77
-        CardItemWidget('真菌毒素污染类型', rightChild: buildMenu(zjlx), bottomLine: true),
78
-        CardItemWidget('近年来本地是否发生重金属污染', rightChild: buildSwitch(jswr), bottomLine: true),
79
-        CardItemWidget('重金属污染类型', rightChild: buildMenu(jslx), bottomLine: true),
80
-      ],
81
-    );
82
-  }
83
-
84
-  Widget buildField({String? hint, TextInputType? inputType}) {
85
-    return TextField(
86
-      keyboardType: inputType,
87
-      textAlign: TextAlign.right,
88
-      decoration: InputDecoration(
89
-        hintText: hint,
90
-        border: InputBorder.none,
91
-        contentPadding: EdgeInsets.zero,
92
-        isDense: true,
93
-      ),
94
-      style: const TextStyle(fontSize: 14),
95
-      inputFormatters: [],
96
-    );
97
-  }
98
-
99
-  Widget buildSwitch(ValueNotifier<bool> notifier) {
100
-    return ValueListenableBuilder<bool>(
101
-      valueListenable: notifier,
102
-      builder: (_, value, __) => SizedBox(
103
-        height: 24,
104
-        child: Switch(
105
-          value: value,
106
-          onChanged: (change) => notifier.value = change,
107
-        ),
108
-      ),
109
-    );
110
-  }
111
-
112
-  Widget buildMenu(ValueNotifier<String?> notifier) {
113
-    return ValueListenableBuilder(
114
-      valueListenable: notifier,
115
-      builder: (_, value, __) {
116
-        return MenuAnchor(
117
-          builder: (_, ctrl, __) {
118
-            return GestureDetector(
119
-              behavior: HitTestBehavior.opaque,
120
-              onTap: () {
121
-                if (ctrl.isOpen) {
122
-                  ctrl.close();
123
-                } else {
124
-                  ctrl.open();
125
-                }
126
-              },
127
-              child: Row(
128
-                mainAxisSize: MainAxisSize.min,
129
-                children: [
130
-                  Text(
131
-                    value ?? '',
132
-                    textAlign: TextAlign.right,
133
-                    style: const TextStyle(
134
-                      color: Color(0xFF01B2C8),
135
-                      fontSize: 16,
136
-                      fontWeight: FontWeight.w500,
137
-                    ),
138
-                  ),
139
-                  const SizedBox(width: 8),
140
-                  arrowDown,
141
-                ],
142
-              ),
143
-            );
144
-          },
145
-          menuChildren: ['选项一', '选项二', '选项三', '选项四']
146
-              .map(
147
-                (e) => MenuItemButton(
148
-                  child: Text(e),
149
-                  onPressed: () => notifier.value = e,
150
-                ),
151
-              )
152
-              .toList(),
153
-        );
154
-      },
155
-    );
156
-  }
157
-}

+ 0 - 151
lib/page/sample_task/reap_sample_task/reap_sample_medicine_page.dart

@@ -1,151 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-import 'package:lszlgl/base/base_state.dart';
3
-import 'package:lszlgl/widget/button.dart';
4
-import 'package:lszlgl/widget/card_item.dart';
5
-
6
-/// 收获扦样-用药情况
7
-class ReapSampleMedicinePage extends StatefulWidget {
8
-  final VoidCallback nextCallback;
9
-  final VoidCallback previousCallback;
10
-
11
-  const ReapSampleMedicinePage({
12
-    super.key,
13
-    required this.nextCallback,
14
-    required this.previousCallback,
15
-  });
16
-
17
-  @override
18
-  State<ReapSampleMedicinePage> createState() => _ReapSampleMedicinePageState();
19
-}
20
-
21
-class _ReapSampleMedicinePageState extends BaseState<ReapSampleMedicinePage> with AutomaticKeepAliveClientMixin {
22
-  late Widget arrowDown;
23
-
24
-  List<String> list = [];
25
-
26
-  void add() {
27
-    setState(() {
28
-      list.add('');
29
-    });
30
-  }
31
-
32
-  @override
33
-  void initState() {
34
-    super.initState();
35
-    arrowDown = Image.asset(imgItemArrowDown, width: 20);
36
-  }
37
-
38
-  @override
39
-  bool get wantKeepAlive => true;
40
-
41
-  @override
42
-  Widget build(BuildContext context) {
43
-    super.build(context);
44
-    return SingleChildScrollView(child: buildList());
45
-  }
46
-
47
-  Widget buildList() {
48
-    return Column(
49
-      children: [
50
-        ...List.generate(
51
-          list.length,
52
-          buildItem,
53
-        ).toList(),
54
-        buildAdd(),
55
-      ],
56
-    );
57
-  }
58
-
59
-  Widget buildItem(int index) {
60
-    return Container(
61
-      clipBehavior: Clip.hardEdge,
62
-      decoration: const BoxDecoration(
63
-        color: Color(0xFFF5FFFD),
64
-        borderRadius: BorderRadius.all(Radius.circular(8)),
65
-      ),
66
-      margin: const EdgeInsets.only(left: 12, right: 12, top: 8),
67
-      child: IntrinsicHeight(
68
-        child: Row(
69
-          mainAxisSize: MainAxisSize.min,
70
-          children: [
71
-            Container(
72
-              color: const Color(0xFF3ACEE6),
73
-              alignment: Alignment.center,
74
-              padding: const EdgeInsets.symmetric(horizontal: 2),
75
-              child: Text(
76
-                '${index + 1}',
77
-                style: const TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.w700),
78
-              ),
79
-            ),
80
-            Expanded(
81
-              child: Column(
82
-                mainAxisSize: MainAxisSize.min,
83
-                children: [
84
-                  CardItemWidget(
85
-                    '使用农药品种',
86
-                    rightChild: buildField(hint: '点击填写'),
87
-                    bottomLine: true,
88
-                    backgroundColor: null,
89
-                  ),
90
-                  CardItemWidget(
91
-                    '使用农药的数量(公斤或毫升/每亩地)',
92
-                    rightChild: buildField(hint: '点击填写'),
93
-                    bottomLine: true,
94
-                    backgroundColor: null,
95
-                  ),
96
-                  CardItemWidget(
97
-                    '施药时间',
98
-                    rightChild: buildField(hint: '点击填写'),
99
-                    bottomLine: true,
100
-                    backgroundColor: null,
101
-                  ),
102
-                  CardItemWidget(
103
-                    '施药方法',
104
-                    rightChild: buildField(hint: '点击填写'),
105
-                    backgroundColor: null,
106
-                  ),
107
-                ],
108
-              ),
109
-            ),
110
-          ],
111
-        ),
112
-      ),
113
-    );
114
-  }
115
-
116
-  Widget buildAdd() {
117
-    return MyButton(
118
-      '添加用药记录',
119
-      onTap: add,
120
-      margin: const EdgeInsets.symmetric(horizontal: 14, vertical: 22),
121
-      gradient: const LinearGradient(colors: [Color(0xFF3BD2E5), Color(0xFF247AF8)]),
122
-    );
123
-  }
124
-
125
-  Widget buildField({String? hint, TextInputType? inputType}) {
126
-    return TextField(
127
-      keyboardType: inputType,
128
-      textAlign: TextAlign.right,
129
-      decoration: InputDecoration(
130
-        hintText: hint,
131
-        border: InputBorder.none,
132
-        contentPadding: EdgeInsets.zero,
133
-        isDense: true,
134
-        counterText: '',
135
-      ),
136
-      style: const TextStyle(fontSize: 14),
137
-      textInputAction: TextInputAction.next,
138
-      inputFormatters: [],
139
-    );
140
-  }
141
-
142
-  Widget buildSwitch(ValueNotifier<bool> notifier) {
143
-    return ValueListenableBuilder<bool>(
144
-      valueListenable: notifier,
145
-      builder: (_, value, __) => Switch(
146
-        value: value,
147
-        onChanged: (change) => notifier.value = change,
148
-      ),
149
-    );
150
-  }
151
-}

+ 0 - 40
lib/page/sample_task/reap_sample_task/reap_sample_org_page.dart

@@ -1,40 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-import 'package:lszlgl/base/base_state.dart';
3
-import 'package:lszlgl/widget/card_item.dart';
4
-
5
-/// 收获扦样-检验机构
6
-class ReapSampleOrgPage extends StatefulWidget {
7
-  final VoidCallback previousCallback;
8
-  final VoidCallback submitCallback;
9
-
10
-  const ReapSampleOrgPage({
11
-    super.key,
12
-    required this.previousCallback,
13
-    required this.submitCallback,
14
-  });
15
-
16
-  @override
17
-  State<ReapSampleOrgPage> createState() => _ReapSampleOrgPageState();
18
-}
19
-
20
-class _ReapSampleOrgPageState extends BaseState<ReapSampleOrgPage> with AutomaticKeepAliveClientMixin {
21
-  @override
22
-  bool get wantKeepAlive => true;
23
-
24
-  @override
25
-  Widget build(BuildContext context) {
26
-    super.build(context);
27
-    return SingleChildScrollView(child: buildList());
28
-  }
29
-
30
-  Widget buildList() {
31
-    return Column(
32
-      children: [
33
-        CardItemWidget('质量检验机构', rightText: '系统代入', bottomLine: true),
34
-        CardItemWidget('机构地址', rightText: '系统代入', bottomLine: true),
35
-        CardItemWidget('食品安全指标检验机构', rightText: '系统代入', bottomLine: true),
36
-        CardItemWidget('机构地址', rightText: '系统代入'),
37
-      ],
38
-    );
39
-  }
40
-}

+ 0 - 154
lib/page/sample_task/reap_sample_task/reap_sample_variety_page.dart

@@ -1,154 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-import 'package:lszlgl/base/base_state.dart';
3
-import 'package:lszlgl/utils/date_time_utils.dart';
4
-import 'package:lszlgl/widget/card_item.dart';
5
-
6
-/// 收获扦样-品种信息
7
-class ReapSampleVarietyPage extends StatefulWidget {
8
-  final VoidCallback nextCallback;
9
-  final VoidCallback previousCallback;
10
-
11
-  const ReapSampleVarietyPage({
12
-    super.key,
13
-    required this.nextCallback,
14
-    required this.previousCallback,
15
-  });
16
-
17
-  @override
18
-  State<ReapSampleVarietyPage> createState() => _ReapSampleVarietyPageState();
19
-}
20
-
21
-class _ReapSampleVarietyPageState extends BaseState<ReapSampleVarietyPage> with AutomaticKeepAliveClientMixin {
22
-  late Widget arrowDown;
23
-
24
-  ValueNotifier<String?> lspl = ValueNotifier(null);
25
-  ValueNotifier<String?> yzpz = ValueNotifier(null);
26
-  ValueNotifier<String?> yzpzlx = ValueNotifier(null);
27
-
28
-  ValueNotifier<String?> shsj = ValueNotifier(null);
29
-  ValueNotifier<String?> qysj = ValueNotifier(null);
30
-
31
-  void showDate(ValueNotifier<String?> notifier) async {
32
-    var date = await showDatePicker(
33
-      context: context,
34
-      firstDate: DateTime(2020),
35
-      lastDate: DateTime.now(),
36
-    );
37
-    if (date == null) return;
38
-    notifier.value = DateTimeUtils.yyyymmdd(date: date);
39
-  }
40
-
41
-  @override
42
-  void initState() {
43
-    super.initState();
44
-    arrowDown = Image.asset(imgItemArrowDown, width: 20);
45
-  }
46
-
47
-  @override
48
-  bool get wantKeepAlive => true;
49
-
50
-  @override
51
-  Widget build(BuildContext context) {
52
-    super.build(context);
53
-    return SingleChildScrollView(child: buildList());
54
-  }
55
-
56
-  Widget buildList() {
57
-    return Column(
58
-      children: [
59
-        CardItemWidget('采样品种', rightText: '自动生成', bottomLine: true),
60
-        CardItemWidget('粮食品类', rightChild: buildMenu(lspl), bottomLine: true),
61
-        CardItemWidget('样品编号', rightText: '自动生成', bottomLine: true),
62
-        CardItemWidget('种植品种', rightChild: buildField(hint: '点击填写'), bottomLine: true),
63
-        CardItemWidget('是否优质品种', rightChild: buildMenu(yzpz), bottomLine: true),
64
-        CardItemWidget('优质品种类型', rightChild: buildMenu(yzpzlx), bottomLine: true),
65
-        ValueListenableBuilder(
66
-          valueListenable: shsj,
67
-          builder: (_, value, __) => CardItemWidget(
68
-            '收获时间',
69
-            rightText: value ?? '',
70
-            trailing: arrowDown,
71
-            bottomLine: true,
72
-            onTap: () => showDate(shsj),
73
-          ),
74
-        ),
75
-        ValueListenableBuilder(
76
-          valueListenable: qysj,
77
-          builder: (_, value, __) => CardItemWidget(
78
-            '扦样时间',
79
-            rightText: value ?? '',
80
-            trailing: arrowDown,
81
-            bottomLine: true,
82
-            onTap: () => showDate(qysj),
83
-          ),
84
-        ),
85
-        CardItemWidget('扦样数量(公斤)', rightChild: buildField(hint: '点击填写'), bottomLine: true),
86
-        CardItemWidget('扦样代表数量(公斤)', rightChild: buildField(hint: '点击填写'), bottomLine: true),
87
-        CardItemWidget('温度(℃)', rightChild: buildField(hint: '点击填写'), bottomLine: true),
88
-        CardItemWidget('湿度(%)', rightChild: buildField(hint: '点击填写')),
89
-      ],
90
-    );
91
-  }
92
-
93
-  Widget buildField({String? hint, TextInputType? inputType}) {
94
-    return TextField(
95
-      keyboardType: inputType,
96
-      textAlign: TextAlign.right,
97
-      decoration: InputDecoration(
98
-        hintText: hint,
99
-        border: InputBorder.none,
100
-        contentPadding: EdgeInsets.zero,
101
-        isDense: true,
102
-      ),
103
-      style: const TextStyle(fontSize: 14),
104
-      textInputAction: TextInputAction.next,
105
-      inputFormatters: [],
106
-    );
107
-  }
108
-
109
-  Widget buildMenu(ValueNotifier<String?> notifier) {
110
-    return ValueListenableBuilder(
111
-      valueListenable: notifier,
112
-      builder: (_, value, __) {
113
-        return MenuAnchor(
114
-          builder: (_, ctrl, __) {
115
-            return GestureDetector(
116
-              behavior: HitTestBehavior.opaque,
117
-              onTap: () {
118
-                if (ctrl.isOpen) {
119
-                  ctrl.close();
120
-                } else {
121
-                  ctrl.open();
122
-                }
123
-              },
124
-              child: Row(
125
-                mainAxisSize: MainAxisSize.min,
126
-                children: [
127
-                  Text(
128
-                    value ?? '',
129
-                    textAlign: TextAlign.right,
130
-                    style: const TextStyle(
131
-                      color: Color(0xFF01B2C8),
132
-                      fontSize: 16,
133
-                      fontWeight: FontWeight.w500,
134
-                    ),
135
-                  ),
136
-                  const SizedBox(width: 8),
137
-                  arrowDown,
138
-                ],
139
-              ),
140
-            );
141
-          },
142
-          menuChildren: ['选项一', '选项二', '选项三', '选项四']
143
-              .map(
144
-                (e) => MenuItemButton(
145
-                  child: Text(e),
146
-                  onPressed: () => notifier.value = e,
147
-                ),
148
-              )
149
-              .toList(),
150
-        );
151
-      },
152
-    );
153
-  }
154
-}

+ 5 - 7
lib/page/sample_task/sample_task_list_page.dart

@@ -13,7 +13,7 @@ import 'package:lszlgl/utils/inject.dart';
13 13
 import 'package:lszlgl/widget/button.dart';
14 14
 import 'package:lszlgl/widget/page_widget.dart';
15 15
 
16
-import 'reap_sample_task/reap_sample_task_page.dart';
16
+import 'reap_sample_detail/reap_sample_task_page.dart';
17 17
 
18 18
 /// 扦样环节列表
19 19
 class SampleTaskListPage extends StatefulWidget {
@@ -34,18 +34,16 @@ class _SampleTaskListPageState extends BaseLifecycleState<SampleTaskListPage> wi
34 34
   late SampleListVM vm;
35 35
 
36 36
   /// 详情
37
-  void startTaskDetail(bool detail, SampleTaskItem data) {
37
+  void startTaskDetail(bool detail, SampleTaskItem data) async {
38
+    bool? success;
38 39
     switch (widget.type) {
39 40
       case StepType.reap:
40
-        startDetail(ReapSampleTaskPageArgs(detail: detail, id: data.id));
41
+        success = await MyRouter.startReapSampleTask(args: ReapSampleTaskPageArgs(detail: detail, id: data.id));
41 42
         break;
42 43
       case StepType.stock:
44
+        // success = await MyRouter.startStockSampleTask(args: StockSampleTaskPageArgs(detail: detail, id: data.id));
43 45
         break;
44 46
     }
45
-  }
46
-
47
-  void startDetail(ReapSampleTaskPageArgs args) async {
48
-    bool? success = await MyRouter.startReapSampleTask(args: args);
49 47
     if (success ?? false) {
50 48
       vm.refreshAll();
51 49
     }

+ 107 - 0
lib/page/sample_task/stock_sample_detail/stock_sample_basic_page.dart

@@ -0,0 +1,107 @@
1
+import 'dart:convert';
2
+
3
+import 'package:flutter/material.dart';
4
+import 'package:flutter/services.dart';
5
+import 'package:lszlgl/utils/input_formatter.dart';
6
+import '../../../base/base_lifecycle_state.dart';
7
+import '../../../model/rsp/sample_task_rsp.dart';
8
+import '../../../service/dict_service.dart';
9
+import '../../../utils/date_time_utils.dart';
10
+import '../../../widget/card_item.dart';
11
+
12
+/// 库存扦样-基础信息
13
+class StockSampleBasicPage extends StatefulWidget {
14
+  final SampleTaskItemKcjcRsp? data;
15
+  final bool detail;
16
+
17
+  const StockSampleBasicPage(
18
+    this.data, {
19
+    super.key,
20
+    this.detail = true,
21
+  });
22
+
23
+  @override
24
+  State<StockSampleBasicPage> createState() => _StockSampleBasicPageState();
25
+}
26
+
27
+class _StockSampleBasicPageState extends BaseLifecycleState<StockSampleBasicPage> with AutomaticKeepAliveClientMixin {
28
+  SampleTaskItemKcjcRsp? data;
29
+  late bool isDetail;
30
+  final rksj = null.notifier<String?>();
31
+
32
+  final rkdjList = <CardMenuData>[].notifier<List<CardMenuData>>();
33
+  final rkdj = null.notifier<CardMenuData?>();
34
+
35
+  final guoChandiList = <CardMenuData>[].notifier<List<CardMenuData>>();
36
+  final guoChandi = null.notifier<CardMenuData?>();
37
+
38
+  @override
39
+  bool get wantKeepAlive => true;
40
+
41
+  @override
42
+  void onInit() {
43
+    data = widget.data;
44
+    isDetail = widget.detail;
45
+
46
+    // 入库时间
47
+    rksj.value = data?.rksj;
48
+    // 入库等级
49
+    rkdjList.value = [1, 2, 3, 4, 5, 6].map((e) {
50
+      var value = CardMenuData(e.toString(), e);
51
+      if (e == data?.rkdj) rkdj.value = value;
52
+      return value;
53
+    }).toList();
54
+    // 产地国
55
+    rootBundle.loadString('assets/json/shijie.json').then((jsonValue) {
56
+      Map<String, dynamic> map = jsonDecode(jsonValue);
57
+      guoChandiList.value = map.values.map((e) {
58
+        var value = CardMenuData(e.toString(), e);
59
+        if (e == data?.guoChandi) guoChandi.value = value;
60
+        return value;
61
+      }).toList();
62
+    });
63
+  }
64
+
65
+  @override
66
+  Widget build(BuildContext context) {
67
+    super.build(context);
68
+    return SingleChildScrollView(child: buildList());
69
+  }
70
+
71
+  Widget buildList() {
72
+    return Column(
73
+      children: [
74
+        CardItemWidget('扦样任务单号', rightText: data?.qyrwdh, bottomLine: true),
75
+        CardItemWidget('扦样单位', rightText: data?.dwmc, bottomLine: true),
76
+        CardItemWidget('扦样人员', rightText: data?.name, bottomLine: true),
77
+        CardItemWidget('监测类别', rightText: DictService.getLabel(DictType.jclb, value: data?.jclb), bottomLine: true),
78
+        CardItemWidget('承储企业名称', rightText: data?.ccqymc, bottomLine: true),
79
+        CardItemWidget('扦样仓房', rightText: data?.qycf, bottomLine: true),
80
+        CardItemWidget('扦样货位', rightText: data?.qyhw, bottomLine: true),
81
+        CardWidgets.buildEdit(
82
+          isDetail,
83
+          '扦样区域',
84
+          data?.qyqy,
85
+          onChanged: (value) => data?.qyqy = value,
86
+        ),
87
+        CardItemWidget('仓型', rightText: data?.cangxing, bottomLine: true),
88
+        CardWidgets.buildDate(
89
+          isDetail,
90
+          '入库时间',
91
+          rksj,
92
+          onResult: (value) => data?.rksj = DateTimeUtils.yyyymmdd(date: value),
93
+        ),
94
+        CardWidgets.buildMenu(isDetail, '入库等级', rkdjList, rkdj, (_, sel) => data?.rkdj = num.parse(sel.value)),
95
+        CardWidgets.buildMenu(isDetail, '产地(进口国)', guoChandiList, guoChandi, (_, sel) => data?.guoChandi = sel.value),
96
+        CardWidgets.buildEdit(
97
+          isDetail,
98
+          '上层粮温(℃)',
99
+          data?.sclw?.toString(),
100
+          inputType: const TextInputType.numberWithOptions(decimal: true),
101
+          formatters: [XNumberTextInputFormatter()],
102
+          onChanged: (value) => data?.sclw = value.isEmpty ? null : num.parse(value),
103
+        ),
104
+      ],
105
+    );
106
+  }
107
+}

+ 62 - 0
lib/page/sample_task/stock_sample_detail/stock_sample_store_page.dart

@@ -0,0 +1,62 @@
1
+import 'package:flutter/material.dart';
2
+import '../../../base/base_lifecycle_state.dart';
3
+import '../../../model/rsp/sample_task_rsp.dart';
4
+import '../../../utils/string_utils.dart';
5
+import '../../../widget/card_item.dart';
6
+
7
+/// 库存扦样-储存信息
8
+class StockSampleStorePage extends StatefulWidget {
9
+  final SampleTaskItemKcjcRsp? data;
10
+  final bool detail;
11
+
12
+  const StockSampleStorePage(
13
+    this.data, {
14
+    super.key,
15
+    this.detail = true,
16
+  });
17
+
18
+  @override
19
+  State<StockSampleStorePage> createState() => _StockSampleStorePageState();
20
+}
21
+
22
+class _StockSampleStorePageState extends BaseLifecycleState<StockSampleStorePage> with AutomaticKeepAliveClientMixin {
23
+  SampleTaskItemKcjcRsp? data;
24
+  late bool isDetail;
25
+
26
+  final sfList = [CardMenuData('是', 0), CardMenuData('否', 1)].notifier<List<CardMenuData>>();
27
+
28
+  final sfsy = null.notifier<CardMenuData?>();
29
+
30
+  final guoChandi = null.notifier<CardMenuData?>();
31
+
32
+  void setNumBoolMenuSelNotifier(ValueNotifier<CardMenuData?> notifier, num? value) {
33
+    if (value == null) return;
34
+    notifier.value = CardMenuData(StringUtils.boolStrByNum(value), value);
35
+  }
36
+
37
+  @override
38
+  bool get wantKeepAlive => true;
39
+
40
+  @override
41
+  void onInit() {
42
+    data = widget.data;
43
+    isDetail = widget.detail;
44
+
45
+    setNumBoolMenuSelNotifier(sfsy, data?.sfsy);
46
+  }
47
+
48
+  @override
49
+  Widget build(BuildContext context) {
50
+    super.build(context);
51
+    return SingleChildScrollView(child: buildList());
52
+  }
53
+
54
+  Widget buildList() {
55
+    return Column(
56
+      children: [
57
+        CardWidgets.buildMenu(isDetail, '是否施药', sfList, sfsy, (_, sel) => data?.sfsy = sel.value),
58
+        CardItemWidget('扦样任务单号', rightText: data?.qyrwdh, bottomLine: true),
59
+      ],
60
+    );
61
+  }
62
+}

+ 290 - 0
lib/page/sample_task/stock_sample_detail/stock_sample_task_page.dart

@@ -0,0 +1,290 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
3
+import 'package:lszlgl/base/base_lifecycle_state.dart';
4
+import 'package:lszlgl/config/colors.dart';
5
+import 'package:lszlgl/model/rsp/sample_task_rsp.dart';
6
+
7
+import '../../../base/base_vm.dart';
8
+import '../../../network/my_api.dart';
9
+import '../../../widget/button.dart';
10
+import '../../../widget/page_widget.dart';
11
+import 'stock_sample_basic_page.dart';
12
+import 'stock_sample_store_page.dart';
13
+import 'stock_sample_variety_page.dart';
14
+
15
+class StockSampleTaskPageArgs {
16
+  final bool detail;
17
+  final num? id;
18
+
19
+  StockSampleTaskPageArgs({
20
+    this.detail = false,
21
+    this.id,
22
+  });
23
+
24
+  @override
25
+  String toString() {
26
+    return {'detail': detail, 'id': id}.toString();
27
+  }
28
+}
29
+
30
+/// 库存扦样任务
31
+class StockSampleTaskPage extends StatefulWidget {
32
+  final StockSampleTaskPageArgs args;
33
+
34
+  const StockSampleTaskPage({
35
+    Key? key,
36
+    required this.args,
37
+  }) : super(key: key);
38
+
39
+  @override
40
+  State<StockSampleTaskPage> createState() => _StockSampleTaskPageState();
41
+}
42
+
43
+class _StockSampleTaskPageState extends BaseLifecycleState<StockSampleTaskPage> with TickerProviderStateMixin {
44
+  late StockSampleTaskPageArgs args;
45
+
46
+  final pageStatus = DataStatusModel<SampleTaskItemKcjcRsp?>().notifier<DataStatusModel<SampleTaskItemKcjcRsp?>>();
47
+
48
+  late PageController pageCtrl;
49
+
50
+  late List<String> tabTextList;
51
+  late List<Widget> pageList;
52
+
53
+  ValueNotifier<int> tabIndex = ValueNotifier(0);
54
+
55
+  void startEdit() async {
56
+    bool? success = await MyRouter.startStockSampleTask(args: StockSampleTaskPageArgs(id: args.id));
57
+    if (success ?? false) {
58
+      MyNavigator.pop(true);
59
+    }
60
+  }
61
+
62
+  void next() {
63
+    if (tabIndex.value < tabTextList.length - 1) {
64
+      pageCtrl.jumpToPage(tabIndex.value + 1);
65
+    }
66
+  }
67
+
68
+  void previous() {
69
+    if (tabIndex.value <= 0) return;
70
+    pageCtrl.jumpToPage(tabIndex.value - 1);
71
+  }
72
+
73
+  void submit() async {
74
+    /*
75
+    MyNavigator.showLoading();
76
+    // 已分解
77
+    pageStatus.value.data?.state = 2;
78
+    try {
79
+      var rsp = await MyApi.get().updateSampleTaskSgjc((pageStatus.value.data ?? SampleTaskItem()).getReqJson());
80
+      if (!mounted) return;
81
+      if (rsp.data ?? false) {
82
+        MyNavigator.showToast('提交成功');
83
+        MyNavigator.pop(true);
84
+      } else {
85
+        MyNavigator.showToast('提交失败');
86
+      }
87
+    } catch (e) {}
88
+    MyNavigator.dismissLoading();
89
+
90
+     */
91
+  }
92
+
93
+  void getDetailData() async {
94
+    pageStatus.update(pageStatus.value.loading());
95
+    try {
96
+      var rsp = await MyApi.get().sampleTaskDetailKcjc(args.id ?? -1);
97
+      var data = rsp.data;
98
+      if (data == null) {
99
+        pageStatus.update(pageStatus.value.empty());
100
+      } else {
101
+        cratePageList(data);
102
+        pageStatus.update(pageStatus.value.success(data: data));
103
+      }
104
+    } catch (e) {
105
+      pageStatus.update(pageStatus.value.error());
106
+    }
107
+  }
108
+
109
+  void cratePageList(SampleTaskItemKcjcRsp data) {
110
+    pageList = [
111
+      StockSampleBasicPage(data, detail: args.detail),
112
+      StockSampleVarietyPage(data, detail: args.detail),
113
+      StockSampleStorePage(data, detail: args.detail),
114
+      StockSampleBasicPage(data, detail: args.detail),
115
+    ];
116
+  }
117
+
118
+  @override
119
+  void initState() {
120
+    super.initState();
121
+    args = widget.args;
122
+    tabTextList = ['基础信息', '品种信息', '储存信息', '检验机构'];
123
+    pageCtrl = PageController();
124
+  }
125
+
126
+  @override
127
+  void onFirstShow(Duration timeStamp) {
128
+    getDetailData();
129
+  }
130
+
131
+  @override
132
+  void onDestroy() {
133
+    pageStatus.dispose();
134
+    pageCtrl.dispose();
135
+  }
136
+
137
+  @override
138
+  Widget build(BuildContext context) {
139
+    return myScaffold(
140
+      child: KeyboardDismissOnTap(
141
+        dismissOnCapturedTaps: true,
142
+        child: Column(
143
+          children: [
144
+            myAppBar(title: args.detail ? '扦样完成详情' : '扦样任务单'),
145
+            pageStatus.builder((v) {
146
+              return switch (v.status) {
147
+                DataStatus.loading => const PageLoadingWidget.loading(),
148
+                DataStatus.error => PageLoadingWidget.error(onTap: getDetailData),
149
+                DataStatus.success => buildBody(),
150
+                _ => const PageLoadingWidget.empty(),
151
+              };
152
+            }),
153
+          ],
154
+        ),
155
+      ),
156
+    );
157
+  }
158
+
159
+  Widget buildBody() {
160
+    return Expanded(
161
+      child: Container(
162
+        clipBehavior: Clip.hardEdge,
163
+        decoration: const BoxDecoration(
164
+          color: Colors.white,
165
+          borderRadius: BorderRadius.vertical(top: Radius.circular(16)),
166
+        ),
167
+        child: Column(
168
+          children: [
169
+            buildTab(),
170
+            Expanded(child: buildPage()),
171
+            buildButton(),
172
+          ],
173
+        ),
174
+      ),
175
+    );
176
+  }
177
+
178
+  Widget buildTab() {
179
+    return ValueListenableBuilder<int>(
180
+      valueListenable: tabIndex,
181
+      builder: (_, value, __) {
182
+        return Container(
183
+          height: 40,
184
+          color: Colors.white,
185
+          padding: const EdgeInsets.symmetric(horizontal: 4),
186
+          child: Row(
187
+            children: List.generate(
188
+              tabTextList.length,
189
+              buildTabItem,
190
+            ),
191
+          ),
192
+        );
193
+      },
194
+    );
195
+  }
196
+
197
+  Widget buildTabItem(int index) {
198
+    var select = index == tabIndex.value;
199
+    return Expanded(
200
+      child: GestureDetector(
201
+        behavior: HitTestBehavior.opaque,
202
+        onTap: () {
203
+          tabIndex.value = index;
204
+          if ((pageCtrl.page?.toInt() ?? 0) == index) return;
205
+          pageCtrl.jumpToPage(index);
206
+        },
207
+        child: Container(
208
+          alignment: Alignment.center,
209
+          child: Stack(
210
+            children: [
211
+              buildTabLine(select),
212
+              Text(
213
+                tabTextList[index],
214
+                style: TextStyle(
215
+                  fontSize: select ? 14 : 12,
216
+                  color: select ? MyColor.c_333333 : MyColor.c_467F86,
217
+                  fontWeight: select ? FontWeight.w700 : FontWeight.w400,
218
+                ),
219
+              ),
220
+            ],
221
+          ),
222
+        ),
223
+      ),
224
+    );
225
+  }
226
+
227
+  Widget buildTabLine(bool show) {
228
+    if (!show) return const SizedBox.shrink();
229
+    return Positioned(
230
+      left: 0,
231
+      right: 0,
232
+      bottom: 0,
233
+      child: Container(
234
+        height: 8,
235
+        decoration: const BoxDecoration(
236
+          gradient: LinearGradient(
237
+            colors: [Color(0xFF3BD2E5), Color(0xFF2379F8)],
238
+          ),
239
+        ),
240
+      ),
241
+    );
242
+  }
243
+
244
+  Widget buildPage() {
245
+    return PageView.builder(
246
+      controller: pageCtrl,
247
+      physics: const NeverScrollableScrollPhysics(),
248
+      onPageChanged: (index) {
249
+        if (index == tabIndex.value) return;
250
+        tabIndex.value = index;
251
+      },
252
+      itemCount: pageList.length,
253
+      itemBuilder: (_, index) => pageList[index],
254
+    );
255
+  }
256
+
257
+  Widget buildButton() {
258
+    Widget child;
259
+    if (args.detail) {
260
+      child = MyButton('重新录入', onTap: startEdit);
261
+    } else {
262
+      child = tabIndex.builder((v) {
263
+        // 第一页
264
+        if (v == 0) return MyButton('下一步', onTap: next);
265
+        // 最后一页
266
+        if (v == tabTextList.length - 1) {
267
+          return Row(
268
+            children: [
269
+              Expanded(flex: 2, child: MyButton('上一步', onTap: previous)),
270
+              const Spacer(flex: 1),
271
+              Expanded(flex: 2, child: MyButton('提交', onTap: submit)),
272
+            ],
273
+          );
274
+        }
275
+        return Row(
276
+          children: [
277
+            Expanded(flex: 2, child: MyButton('上一步', onTap: previous)),
278
+            const Spacer(flex: 1),
279
+            Expanded(flex: 2, child: MyButton('下一步', onTap: next)),
280
+          ],
281
+        );
282
+      });
283
+    }
284
+    return Container(
285
+      color: const Color(0xFFF1F7F6),
286
+      padding: const EdgeInsets.all(12),
287
+      child: child,
288
+    );
289
+  }
290
+}

+ 78 - 0
lib/page/sample_task/stock_sample_detail/stock_sample_variety_page.dart

@@ -0,0 +1,78 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:lszlgl/utils/input_formatter.dart';
3
+import '../../../base/base_lifecycle_state.dart';
4
+import '../../../model/rsp/sample_task_rsp.dart';
5
+import '../../../utils/date_time_utils.dart';
6
+import '../../../widget/card_item.dart';
7
+
8
+/// 库存扦样-品种信息
9
+class StockSampleVarietyPage extends StatefulWidget {
10
+  final SampleTaskItemKcjcRsp? data;
11
+  final bool detail;
12
+
13
+  const StockSampleVarietyPage(
14
+    this.data, {
15
+    super.key,
16
+    this.detail = true,
17
+  });
18
+
19
+  @override
20
+  State<StockSampleVarietyPage> createState() => _StockSampleVarietyPageState();
21
+}
22
+
23
+class _StockSampleVarietyPageState extends BaseLifecycleState<StockSampleVarietyPage> with AutomaticKeepAliveClientMixin {
24
+  SampleTaskItemKcjcRsp? data;
25
+  late bool isDetail;
26
+
27
+  final qysj = null.notifier<String?>();
28
+
29
+  @override
30
+  bool get wantKeepAlive => true;
31
+
32
+  @override
33
+  void onInit() {
34
+    data = widget.data;
35
+    isDetail = widget.detail;
36
+
37
+    qysj.value = data?.qysj;
38
+  }
39
+
40
+  @override
41
+  Widget build(BuildContext context) {
42
+    super.build(context);
43
+    return SingleChildScrollView(child: buildList());
44
+  }
45
+
46
+  Widget buildList() {
47
+    return Column(
48
+      children: [
49
+        CardItemWidget('采样品种', rightText: data?.cypzName, bottomLine: true),
50
+        CardItemWidget('样品编号', rightText: data?.ypbh, bottomLine: true),
51
+        CardItemWidget('库存性质', rightText: data?.lsxz, bottomLine: true),
52
+        CardWidgets.buildEdit(
53
+          isDetail,
54
+          '代表数量(吨)',
55
+          data?.dbsl?.toString(),
56
+          inputType: const TextInputType.numberWithOptions(decimal: true),
57
+          formatters: [XNumberTextInputFormatter()],
58
+          onChanged: (value) => data?.dbsl = value.isEmpty ? null : num.parse(value),
59
+        ),
60
+        CardItemWidget('所在货位粮食总数(吨)', rightText: data?.szhwlszs, bottomLine: true),
61
+        CardWidgets.buildEdit(
62
+          isDetail,
63
+          '收获年度',
64
+          data?.shnd,
65
+          inputType: const TextInputType.numberWithOptions(decimal: false),
66
+          formatters: [XNumberTextInputFormatter(isAllowDecimal: false)],
67
+          onChanged: (value) => data?.shnd = value,
68
+        ),
69
+        CardWidgets.buildDate(
70
+          isDetail,
71
+          '扦样时间',
72
+          qysj,
73
+          onResult: (value) => data?.qysj = DateTimeUtils.yyyymmdd(date: value),
74
+        ),
75
+      ],
76
+    );
77
+  }
78
+}

+ 11 - 1
lib/router/my_router.dart

@@ -1,12 +1,14 @@
1 1
 import 'package:lszlgl/page/login/login_page.dart';
2 2
 import 'package:lszlgl/page/main_tab_page.dart';
3
-import 'package:lszlgl/page/sample_task/reap_sample_task/reap_sample_task_page.dart';
3
+import 'package:lszlgl/page/sample_task/reap_sample_detail/reap_sample_task_page.dart';
4 4
 import 'package:lszlgl/page/sample_task/sample_task_list_tab_page.dart';
5 5
 import 'package:lszlgl/page/user_center/account_manage_page.dart';
6 6
 import 'package:lszlgl/page/user_center/change_pwd_page.dart';
7 7
 import 'package:lszlgl/page/user_center/setting_page.dart';
8 8
 import 'package:lszlgl/router/my_navigator.dart';
9 9
 
10
+import '../page/sample_task/stock_sample_detail/stock_sample_task_page.dart';
11
+
10 12
 // 根页面
11 13
 const rLoginPage = '/';
12 14
 // 主页
@@ -21,6 +23,8 @@ const rChangePwdPage = '/ChangePwdPage';
21 23
 const rSampleTaskListTabPage = '/SampleTaskListTabPage';
22 24
 // 收获扦样任务
23 25
 const rReapSampleTaskPage = '/ReapSampleTaskPage';
26
+// 库存扦样任务
27
+const rStockSampleTaskPage = '/StockSampleTaskPage';
24 28
 
25 29
 final Map<String, MyNavigatorBuilder> rRouteMap = {
26 30
   // 根页面
@@ -31,6 +35,7 @@ final Map<String, MyNavigatorBuilder> rRouteMap = {
31 35
   rChangePwdPage: (context, args) => const ChangePwdPage(),
32 36
   rSampleTaskListTabPage: (context, args) => SampleTaskListTabPage(args: args as SampleTaskListTabPageArgs?),
33 37
   rReapSampleTaskPage: (context, args) => ReapSampleTaskPage(args: args as ReapSampleTaskPageArgs),
38
+  rStockSampleTaskPage: (context, args) => StockSampleTaskPage(args: args as StockSampleTaskPageArgs),
34 39
 };
35 40
 
36 41
 class MyRouter {
@@ -78,4 +83,9 @@ class MyRouter {
78 83
   static Future<dynamic> startReapSampleTask({ReapSampleTaskPageArgs? args}) {
79 84
     return MyNavigator.push(rReapSampleTaskPage, args: args ?? ReapSampleTaskPageArgs());
80 85
   }
86
+
87
+  /// 库存扦样任务
88
+  static Future<dynamic> startStockSampleTask({StockSampleTaskPageArgs? args}) {
89
+    return MyNavigator.push(rStockSampleTaskPage, args: args ?? StockSampleTaskPageArgs());
90
+  }
81 91
 }

+ 4 - 2
lib/widget/card_item.dart

@@ -313,7 +313,7 @@ class CardWidgets {
313 313
     bool isDetail,
314 314
     String title,
315 315
     ValueNotifier<String?> notifier, {
316
-    void Function(DateTime?)? onResult,
316
+    String? Function(DateTime?)? onResult,
317 317
     DateTime? firstDate,
318 318
     DateTime? lastDate,
319 319
   }) {
@@ -332,7 +332,9 @@ class CardWidgets {
332 332
             firstDate: firstDate ?? DateTime(2020),
333 333
             lastDate: lastDate ?? DateTime.now(),
334 334
           );
335
-          onResult?.call(date);
335
+          if (onResult != null) {
336
+            notifier.value = onResult.call(date);
337
+          }
336 338
         },
337 339
       );
338 340
     });

文件差异内容过多而无法显示
+ 134 - 134
pubspec.lock


+ 2 - 1
pubspec.yaml

@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
16 16
 # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
17 17
 # In Windows, build-name is used as the major, minor, and patch parts
18 18
 # of the product and file versions while build-number is used as the build suffix.
19
-version: 0.0.3+3
19
+version: 0.0.4+4
20 20
 
21 21
 environment:
22 22
   sdk: '>=3.1.5 <4.0.0'
@@ -109,6 +109,7 @@ flutter:
109 109
   # To add assets to your application, add an assets section, like this:
110 110
   assets:
111 111
     - assets/images/
112
+    - assets/json/
112 113
 
113 114
   # An image asset can refer to one or more resolution-specific "variants", see
114 115
   # https://flutter.dev/assets-and-images/#resolution-aware