Reason Pun

增加了口音选择弹出菜单

1 -[
2 - {
3 - "id": 1,
4 - "bankName": "民生银行",
5 - "firstLetter": "M"
6 - },
7 - {
8 - "id": 2,
9 - "bankName": "工商银行",
10 - "firstLetter": "G"
11 - },
12 - {
13 - "id": 3,
14 - "bankName": "农业银行",
15 - "firstLetter": "N"
16 - },
17 - {
18 - "id": 4,
19 - "bankName": "中国银行",
20 - "firstLetter": "Z"
21 - },
22 - {
23 - "id": 5,
24 - "bankName": "建设银行",
25 - "firstLetter": "J"
26 - },
27 - {
28 - "id": 6,
29 - "bankName": "交通银行",
30 - "firstLetter": "J"
31 - },
32 - {
33 - "id": 7,
34 - "bankName": "中信银行",
35 - "firstLetter": "Z"
36 - },
37 - {
38 - "id": 8,
39 - "bankName": "招商银行",
40 - "firstLetter": "Z"
41 - },
42 - {
43 - "id": 9,
44 - "bankName": "兴业银行",
45 - "firstLetter": "X"
46 - },
47 - {
48 - "id": 10,
49 - "bankName": "浦发银行",
50 - "firstLetter": "P"
51 - },
52 - {
53 - "id": 16,
54 - "bankName": "光大银行",
55 - "firstLetter": "G"
56 - },
57 - {
58 - "id": 17,
59 - "bankName": "华夏银行",
60 - "firstLetter": "H"
61 - },
62 - {
63 - "id": 18,
64 - "bankName": "广发银行",
65 - "firstLetter": "G"
66 - },
67 - {
68 - "id": 19,
69 - "bankName": "平安银行",
70 - "firstLetter": "P"
71 - },
72 - {
73 - "id": 20,
74 - "bankName": "北京银行",
75 - "firstLetter": "B"
76 - },
77 - {
78 - "id": 43,
79 - "bankName": "上海银行",
80 - "firstLetter": "S"
81 - },
82 - {
83 - "id": 44,
84 - "bankName": "南京银行",
85 - "firstLetter": "N"
86 - },
87 - {
88 - "id": 48,
89 - "bankName": "杭州银行",
90 - "firstLetter": "H"
91 - },
92 - {
93 - "id": 49,
94 - "bankName": "宁波银行",
95 - "firstLetter": "N"
96 - },
97 - {
98 - "id": 54,
99 - "bankName": "浙江稠州商业银行",
100 - "firstLetter": "Z"
101 - },
102 - {
103 - "id": 83,
104 - "bankName": "汉口银行",
105 - "firstLetter": "H"
106 - },
107 - {
108 - "id": 84,
109 - "bankName": "长沙银行",
110 - "firstLetter": "C"
111 - },
112 - {
113 - "id": 116,
114 - "bankName": "浙商银行",
115 - "firstLetter": "Z"
116 - },
117 - {
118 - "id": 118,
119 - "bankName": "渤海银行",
120 - "firstLetter": "B"
121 - },
122 - {
123 - "id": 127,
124 - "bankName": "上海农商银行",
125 - "firstLetter": "S"
126 - },
127 - {
128 - "id": 128,
129 - "bankName": "北京农商行",
130 - "firstLetter": "B"
131 - },
132 - {
133 - "id": 143,
134 - "bankName": "中国邮储银行",
135 - "firstLetter": "Y"
136 - }
137 -]
...\ No newline at end of file ...\ No newline at end of file
1 -[
2 - {
3 - "id": 13035,
4 - "bankName": "西安市城南支行",
5 - "firstLetter": "X"
6 - },
7 - {
8 - "id": 13036,
9 - "bankName": "西安经济技术开发区支行",
10 - "firstLetter": "X"
11 - },
12 - {
13 - "id": 13037,
14 - "bankName": "西安市东新街支行",
15 - "firstLetter": "X"
16 - },
17 - {
18 - "id": 13038,
19 - "bankName": "西安南大街支行",
20 - "firstLetter": "X"
21 - },
22 - {
23 - "id": 13039,
24 - "bankName": "西安市解放路支行",
25 - "firstLetter": "X"
26 - },
27 - {
28 - "id": 13040,
29 - "bankName": "西安市太华路支行",
30 - "firstLetter": "X"
31 - },
32 - {
33 - "id": 13041,
34 - "bankName": "西安民乐园支行",
35 - "firstLetter": "X"
36 - },
37 - {
38 - "id": 13042,
39 - "bankName": "西安市东大街支行",
40 - "firstLetter": "X"
41 - },
42 - {
43 - "id": 13043,
44 - "bankName": "西安南院门支行",
45 - "firstLetter": "X"
46 - },
47 - {
48 - "id": 13044,
49 - "bankName": "西安东关支行",
50 - "firstLetter": "X"
51 - },
52 - {
53 - "id": 13045,
54 - "bankName": "西安和平路支行",
55 - "firstLetter": "X"
56 - },
57 - {
58 - "id": 13046,
59 - "bankName": "西安互助路支行",
60 - "firstLetter": "X"
61 - },
62 - {
63 - "id": 13047,
64 - "bankName": "西安市北大街支行",
65 - "firstLetter": "X"
66 - },
67 - {
68 - "id": 13048,
69 - "bankName": "西安西大街支行",
70 - "firstLetter": "X"
71 - },
72 - {
73 - "id": 13049,
74 - "bankName": "西安星火路支行",
75 - "firstLetter": "X"
76 - },
77 - {
78 - "id": 13050,
79 - "bankName": "西安市南关支行",
80 - "firstLetter": "X"
81 - },
82 - {
83 - "id": 13051,
84 - "bankName": "西安小寨支行",
85 - "firstLetter": "X"
86 - },
87 - {
88 - "id": 13052,
89 - "bankName": "西安雁塔路支行",
90 - "firstLetter": "X"
91 - },
92 - {
93 - "id": 13053,
94 - "bankName": "西安含光路支行",
95 - "firstLetter": "X"
96 - },
97 - {
98 - "id": 13054,
99 - "bankName": "西安铁路局支行",
100 - "firstLetter": "X"
101 - },
102 - {
103 - "id": 13055,
104 - "bankName": "西安电子工业区支行",
105 - "firstLetter": "X"
106 - },
107 - {
108 - "id": 13056,
109 - "bankName": "西安大雁塔支行",
110 - "firstLetter": "X"
111 - },
112 - {
113 - "id": 13057,
114 - "bankName": "西安市土门支行",
115 - "firstLetter": "X"
116 - },
117 - {
118 - "id": 13058,
119 - "bankName": "西安市纺织城支行",
120 - "firstLetter": "X"
121 - },
122 - {
123 - "id": 13059,
124 - "bankName": "西安市韩森寨支行",
125 - "firstLetter": "X"
126 - },
127 - {
128 - "id": 13060,
129 - "bankName": "西安咸宁路支行",
130 - "firstLetter": "X"
131 - },
132 - {
133 - "id": 13061,
134 - "bankName": "西安市韩森寨支行万寿路分理处",
135 - "firstLetter": "X"
136 - },
137 - {
138 - "id": 13062,
139 - "bankName": "西安市阎良区支行",
140 - "firstLetter": "X"
141 - },
142 - {
143 - "id": 13063,
144 - "bankName": "西安市周至县支行",
145 - "firstLetter": "X"
146 - },
147 - {
148 - "id": 13064,
149 - "bankName": "西安市户县支行",
150 - "firstLetter": "X"
151 - },
152 - {
153 - "id": 13065,
154 - "bankName": "西安市临潼区支行",
155 - "firstLetter": "X"
156 - },
157 - {
158 - "id": 13066,
159 - "bankName": "西安市高新技术开发区支行",
160 - "firstLetter": "X"
161 - },
162 - {
163 - "id": 13067,
164 - "bankName": "西安劳动南路支行",
165 - "firstLetter": "X"
166 - },
167 - {
168 - "id": 13068,
169 - "bankName": "西安市未央支行",
170 - "firstLetter": "X"
171 - },
172 - {
173 - "id": 13069,
174 - "bankName": "西安徐家湾支行",
175 - "firstLetter": "X"
176 - },
177 - {
178 - "id": 17731,
179 - "bankName": "西安莲湖路支行",
180 - "firstLetter": "X"
181 - },
182 - {
183 - "id": 17747,
184 - "bankName": "陕西省西安凤城八路分理处",
185 - "firstLetter": "S"
186 - },
187 - {
188 - "id": 17748,
189 - "bankName": "西安长乐中路支行",
190 - "firstLetter": "X"
191 - },
192 - {
193 - "id": 17749,
194 - "bankNumber": "102791013020",
195 - "bankName": "陕西省西安咸宁中路支行",
196 - "firstLetter": "S"
197 - },
198 - {
199 - "id": 17750,
200 - "bankName": "西安万寿南路分理处",
201 - "firstLetter": "X"
202 - },
203 - {
204 - "id": 17759,
205 - "bankName": "陕西省西安紫薇田园都市分理处",
206 - "firstLetter": "S"
207 - }
208 -]
...\ No newline at end of file ...\ No newline at end of file
This diff is collapsed. Click to expand it.
1 -[
2 - {
3 - "id": "1",
4 - "name": "超市便利"
5 - },
6 - {
7 - "id": "2",
8 - "name": "生鲜果蔬"
9 - },
10 - {
11 - "id": "3",
12 - "name": "零食小吃"
13 - },
14 - {
15 - "id": "4",
16 - "name": "美食餐饮"
17 - },
18 - {
19 - "id": "5",
20 - "name": "鲜花烘培"
21 - },
22 - {
23 - "id": "6",
24 - "name": "生活服务"
25 - },
26 - {
27 - "id": "7",
28 - "name": "其他"
29 - },
30 - {
31 - "id": "8",
32 - "name": "综合"
33 - },
34 - {
35 - "id": "10",
36 - "name": "美容个护"
37 - },
38 - {
39 - "id": "11",
40 - "name": "家居生活"
41 - },
42 - {
43 - "id": "12",
44 - "name": "服饰箱包"
45 - },
46 - {
47 - "id": "13",
48 - "name": "母婴玩具"
49 - },
50 - {
51 - "id": "15",
52 - "name": "海淘进口"
53 - },
54 - {
55 - "id": "755",
56 - "name": "快递代收"
57 - },
58 - {
59 - "id": "756",
60 - "name": "食品保健"
61 - },
62 - {
63 - "id": "764",
64 - "name": "家居生活"
65 - },
66 - {
67 - "id": "769",
68 - "name": "米面杂粮"
69 - },
70 - {
71 - "id": "786",
72 - "name": "水果生鲜"
73 - },
74 - {
75 - "id": "807",
76 - "name": "社区健身"
77 - },
78 - {
79 - "id": "811",
80 - "name": "艺术礼品"
81 - },
82 - {
83 - "id": "814",
84 - "name": "今日特卖"
85 - },
86 - {
87 - "id": "816",
88 - "name": "周边旅游"
89 - },
90 - {
91 - "id": "820",
92 - "name": "家装建材"
93 - },
94 - {
95 - "id": "823",
96 - "name": "虚拟商品"
97 - },
98 - {
99 - "id": "14057",
100 - "name": "生活用品"
101 - },
102 - {
103 - "id": "14181",
104 - "name": "手机数码"
105 - }
106 -]
...\ No newline at end of file ...\ No newline at end of file
1 -[
2 - {
3 - "id": "15677",
4 - "name": "厨房用具"
5 - },
6 - {
7 - "id": "15690",
8 - "name": "精美餐具"
9 - },
10 - {
11 - "id": "15698",
12 - "name": "家纺"
13 - },
14 - {
15 - "id": "15717",
16 - "name": "家具"
17 - },
18 - {
19 - "id": "15740",
20 - "name": "灯具"
21 - },
22 - {
23 - "id": "15755",
24 - "name": "生活日用"
25 - },
26 - {
27 - "id": "15765",
28 - "name": "宠物用品"
29 - },
30 - {
31 - "id": "15773",
32 - "name": "家装建材"
33 - },
34 - {
35 - "id": "15795",
36 - "name": "赠品"
37 - },
38 - {
39 - "id": "15797",
40 - "name": "家装软饰"
41 - },
42 - {
43 - "id": "15814",
44 - "name": "收纳用品"
45 - },
46 - {
47 - "id": "26541",
48 - "name": "演出票务"
49 - },
50 - {
51 - "id": "26551",
52 - "name": "健康体检"
53 - },
54 - {
55 - "id": "26554",
56 - "name": "教育培训"
57 - },
58 - {
59 - "id": "26561",
60 - "name": "汽车保养"
61 - },
62 - {
63 - "id": "26563",
64 - "name": "影视会员"
65 - },
66 - {
67 - "id": "26565",
68 - "name": "摄影、摄像"
69 - }
70 -]
...\ No newline at end of file ...\ No newline at end of file
1 -[
2 - {
3 - "id": "15691",
4 - "name": "酒具/杯具"
5 - },
6 - {
7 - "id": "15692",
8 - "name": "水具"
9 - },
10 - {
11 - "id": "15693",
12 - "name": "筷勺/刀叉"
13 - },
14 - {
15 - "id": "15694",
16 - "name": "碗碟"
17 - },
18 - {
19 - "id": "15695",
20 - "name": "组合套装"
21 - },
22 - {
23 - "id": "15696",
24 - "name": "美食工具"
25 - },
26 - {
27 - "id": "15697",
28 - "name": "茶具/咖啡具"
29 - }
30 -]
...\ No newline at end of file ...\ No newline at end of file
1 +[
2 + {
3 + "id": "1",
4 + "name": "普通话"
5 + },
6 + {
7 + "id": "2",
8 + "name": "四川话"
9 + },
10 + {
11 + "id": "3",
12 + "name": "山东话"
13 + },
14 + {
15 + "id": "4",
16 + "name": "闽南话"
17 + },
18 + {
19 + "id": "5",
20 + "name": "东北话"
21 + }
22 +]
...\ No newline at end of file ...\ No newline at end of file
...@@ -4,8 +4,15 @@ ...@@ -4,8 +4,15 @@
4 4
5 // This file is automatically generated. DO NOT EDIT, all your changes would be lost. 5 // This file is automatically generated. DO NOT EDIT, all your changes would be lost.
6 import 'package:one_poem/account/models/user_entity.dart'; 6 import 'package:one_poem/account/models/user_entity.dart';
7 +import 'package:one_poem/generated/json/user_entity.g.dart';
7 import 'package:one_poem/category/models/category_item_entity.dart'; 8 import 'package:one_poem/category/models/category_item_entity.dart';
9 +import 'package:one_poem/generated/json/category_item_entity.g.dart';
10 +import 'package:one_poem/poem/models/lang_sort_entity.dart';
11 +import 'package:one_poem/generated/json/lang_sort_entity.g.dart';
12 +import 'package:one_poem/poem/models/search_entity.dart';
13 +import 'package:one_poem/generated/json/search_entity.g.dart';
8 import 'package:one_poem/timeline/models/friend_entity.dart'; 14 import 'package:one_poem/timeline/models/friend_entity.dart';
15 +import 'package:one_poem/generated/json/friend_entity.g.dart';
9 16
10 JsonConvert jsonConvert = JsonConvert(); 17 JsonConvert jsonConvert = JsonConvert();
11 18
...@@ -82,6 +89,21 @@ class JsonConvert { ...@@ -82,6 +89,21 @@ class JsonConvert {
82 if(type == (CategoryItemEntity).toString()){ 89 if(type == (CategoryItemEntity).toString()){
83 return CategoryItemEntity.fromJson(json) as M; 90 return CategoryItemEntity.fromJson(json) as M;
84 } 91 }
92 + if(type == (LangSortEntity).toString()){
93 + return LangSortEntity.fromJson(json) as M;
94 + }
95 + if(type == (SearchEntity).toString()){
96 + return SearchEntity.fromJson(json) as M;
97 + }
98 + if(type == (SearchItems).toString()){
99 + return SearchItems.fromJson(json) as M;
100 + }
101 + if(type == (SearchItemsOwner).toString()){
102 + return SearchItemsOwner.fromJson(json) as M;
103 + }
104 + if(type == (SearchItemsLicense).toString()){
105 + return SearchItemsLicense.fromJson(json) as M;
106 + }
85 if(type == (FriendEntity).toString()){ 107 if(type == (FriendEntity).toString()){
86 return FriendEntity.fromJson(json) as M; 108 return FriendEntity.fromJson(json) as M;
87 } 109 }
...@@ -102,6 +124,21 @@ class JsonConvert { ...@@ -102,6 +124,21 @@ class JsonConvert {
102 if(<CategoryItemEntity>[] is M){ 124 if(<CategoryItemEntity>[] is M){
103 return data.map<CategoryItemEntity>((Map<String, dynamic> e) => CategoryItemEntity.fromJson(e)).toList() as M; 125 return data.map<CategoryItemEntity>((Map<String, dynamic> e) => CategoryItemEntity.fromJson(e)).toList() as M;
104 } 126 }
127 + if(<LangSortEntity>[] is M){
128 + return data.map<LangSortEntity>((Map<String, dynamic> e) => LangSortEntity.fromJson(e)).toList() as M;
129 + }
130 + if(<SearchEntity>[] is M){
131 + return data.map<SearchEntity>((Map<String, dynamic> e) => SearchEntity.fromJson(e)).toList() as M;
132 + }
133 + if(<SearchItems>[] is M){
134 + return data.map<SearchItems>((Map<String, dynamic> e) => SearchItems.fromJson(e)).toList() as M;
135 + }
136 + if(<SearchItemsOwner>[] is M){
137 + return data.map<SearchItemsOwner>((Map<String, dynamic> e) => SearchItemsOwner.fromJson(e)).toList() as M;
138 + }
139 + if(<SearchItemsLicense>[] is M){
140 + return data.map<SearchItemsLicense>((Map<String, dynamic> e) => SearchItemsLicense.fromJson(e)).toList() as M;
141 + }
105 if(<FriendEntity>[] is M){ 142 if(<FriendEntity>[] is M){
106 return data.map<FriendEntity>((Map<String, dynamic> e) => FriendEntity.fromJson(e)).toList() as M; 143 return data.map<FriendEntity>((Map<String, dynamic> e) => FriendEntity.fromJson(e)).toList() as M;
107 } 144 }
......
1 +import 'package:one_poem/generated/json/base/json_convert_content.dart';
2 +import 'package:one_poem/poem/models/lang_sort_entity.dart';
3 +
4 +LangSortEntity $LangSortEntityFromJson(Map<String, dynamic> json) {
5 + final LangSortEntity langSortEntity = LangSortEntity();
6 + final String? id = jsonConvert.convert<String>(json['id']);
7 + if (id != null) {
8 + langSortEntity.id = id;
9 + }
10 + final String? name = jsonConvert.convert<String>(json['name']);
11 + if (name != null) {
12 + langSortEntity.name = name;
13 + }
14 + return langSortEntity;
15 +}
16 +
17 +Map<String, dynamic> $LangSortEntityToJson(LangSortEntity entity) {
18 + final Map<String, dynamic> data = <String, dynamic>{};
19 + data['id'] = entity.id;
20 + data['name'] = entity.name;
21 + return data;
22 +}
...\ No newline at end of file ...\ No newline at end of file
...@@ -7,13 +7,11 @@ SearchEntity $SearchEntityFromJson(Map<String, dynamic> json) { ...@@ -7,13 +7,11 @@ SearchEntity $SearchEntityFromJson(Map<String, dynamic> json) {
7 if (totalCount != null) { 7 if (totalCount != null) {
8 searchEntity.totalCount = totalCount; 8 searchEntity.totalCount = totalCount;
9 } 9 }
10 - final bool? incompleteResults = 10 + final bool? incompleteResults = jsonConvert.convert<bool>(json['incomplete_results']);
11 - jsonConvert.convert<bool>(json['incomplete_results']);
12 if (incompleteResults != null) { 11 if (incompleteResults != null) {
13 searchEntity.incompleteResults = incompleteResults; 12 searchEntity.incompleteResults = incompleteResults;
14 } 13 }
15 - final List<SearchItems>? items = 14 + final List<SearchItems>? items = jsonConvert.convertListNotNull<SearchItems>(json['items']);
16 - jsonConvert.convertListNotNull<SearchItems>(json['items']);
17 if (items != null) { 15 if (items != null) {
18 searchEntity.items = items; 16 searchEntity.items = items;
19 } 17 }
...@@ -50,8 +48,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) { ...@@ -50,8 +48,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) {
50 if (private != null) { 48 if (private != null) {
51 searchItems.private = private; 49 searchItems.private = private;
52 } 50 }
53 - final SearchItemsOwner? owner = 51 + final SearchItemsOwner? owner = jsonConvert.convert<SearchItemsOwner>(json['owner']);
54 - jsonConvert.convert<SearchItemsOwner>(json['owner']);
55 if (owner != null) { 52 if (owner != null) {
56 searchItems.owner = owner; 53 searchItems.owner = owner;
57 } 54 }
...@@ -79,8 +76,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) { ...@@ -79,8 +76,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) {
79 if (keysUrl != null) { 76 if (keysUrl != null) {
80 searchItems.keysUrl = keysUrl; 77 searchItems.keysUrl = keysUrl;
81 } 78 }
82 - final String? collaboratorsUrl = 79 + final String? collaboratorsUrl = jsonConvert.convert<String>(json['collaborators_url']);
83 - jsonConvert.convert<String>(json['collaborators_url']);
84 if (collaboratorsUrl != null) { 80 if (collaboratorsUrl != null) {
85 searchItems.collaboratorsUrl = collaboratorsUrl; 81 searchItems.collaboratorsUrl = collaboratorsUrl;
86 } 82 }
...@@ -92,8 +88,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) { ...@@ -92,8 +88,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) {
92 if (hooksUrl != null) { 88 if (hooksUrl != null) {
93 searchItems.hooksUrl = hooksUrl; 89 searchItems.hooksUrl = hooksUrl;
94 } 90 }
95 - final String? issueEventsUrl = 91 + final String? issueEventsUrl = jsonConvert.convert<String>(json['issue_events_url']);
96 - jsonConvert.convert<String>(json['issue_events_url']);
97 if (issueEventsUrl != null) { 92 if (issueEventsUrl != null) {
98 searchItems.issueEventsUrl = issueEventsUrl; 93 searchItems.issueEventsUrl = issueEventsUrl;
99 } 94 }
...@@ -101,8 +96,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) { ...@@ -101,8 +96,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) {
101 if (eventsUrl != null) { 96 if (eventsUrl != null) {
102 searchItems.eventsUrl = eventsUrl; 97 searchItems.eventsUrl = eventsUrl;
103 } 98 }
104 - final String? assigneesUrl = 99 + final String? assigneesUrl = jsonConvert.convert<String>(json['assignees_url']);
105 - jsonConvert.convert<String>(json['assignees_url']);
106 if (assigneesUrl != null) { 100 if (assigneesUrl != null) {
107 searchItems.assigneesUrl = assigneesUrl; 101 searchItems.assigneesUrl = assigneesUrl;
108 } 102 }
...@@ -134,28 +128,23 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) { ...@@ -134,28 +128,23 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) {
134 if (statusesUrl != null) { 128 if (statusesUrl != null) {
135 searchItems.statusesUrl = statusesUrl; 129 searchItems.statusesUrl = statusesUrl;
136 } 130 }
137 - final String? languagesUrl = 131 + final String? languagesUrl = jsonConvert.convert<String>(json['languages_url']);
138 - jsonConvert.convert<String>(json['languages_url']);
139 if (languagesUrl != null) { 132 if (languagesUrl != null) {
140 searchItems.languagesUrl = languagesUrl; 133 searchItems.languagesUrl = languagesUrl;
141 } 134 }
142 - final String? stargazersUrl = 135 + final String? stargazersUrl = jsonConvert.convert<String>(json['stargazers_url']);
143 - jsonConvert.convert<String>(json['stargazers_url']);
144 if (stargazersUrl != null) { 136 if (stargazersUrl != null) {
145 searchItems.stargazersUrl = stargazersUrl; 137 searchItems.stargazersUrl = stargazersUrl;
146 } 138 }
147 - final String? contributorsUrl = 139 + final String? contributorsUrl = jsonConvert.convert<String>(json['contributors_url']);
148 - jsonConvert.convert<String>(json['contributors_url']);
149 if (contributorsUrl != null) { 140 if (contributorsUrl != null) {
150 searchItems.contributorsUrl = contributorsUrl; 141 searchItems.contributorsUrl = contributorsUrl;
151 } 142 }
152 - final String? subscribersUrl = 143 + final String? subscribersUrl = jsonConvert.convert<String>(json['subscribers_url']);
153 - jsonConvert.convert<String>(json['subscribers_url']);
154 if (subscribersUrl != null) { 144 if (subscribersUrl != null) {
155 searchItems.subscribersUrl = subscribersUrl; 145 searchItems.subscribersUrl = subscribersUrl;
156 } 146 }
157 - final String? subscriptionUrl = 147 + final String? subscriptionUrl = jsonConvert.convert<String>(json['subscription_url']);
158 - jsonConvert.convert<String>(json['subscription_url']);
159 if (subscriptionUrl != null) { 148 if (subscriptionUrl != null) {
160 searchItems.subscriptionUrl = subscriptionUrl; 149 searchItems.subscriptionUrl = subscriptionUrl;
161 } 150 }
...@@ -163,8 +152,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) { ...@@ -163,8 +152,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) {
163 if (commitsUrl != null) { 152 if (commitsUrl != null) {
164 searchItems.commitsUrl = commitsUrl; 153 searchItems.commitsUrl = commitsUrl;
165 } 154 }
166 - final String? gitCommitsUrl = 155 + final String? gitCommitsUrl = jsonConvert.convert<String>(json['git_commits_url']);
167 - jsonConvert.convert<String>(json['git_commits_url']);
168 if (gitCommitsUrl != null) { 156 if (gitCommitsUrl != null) {
169 searchItems.gitCommitsUrl = gitCommitsUrl; 157 searchItems.gitCommitsUrl = gitCommitsUrl;
170 } 158 }
...@@ -172,8 +160,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) { ...@@ -172,8 +160,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) {
172 if (commentsUrl != null) { 160 if (commentsUrl != null) {
173 searchItems.commentsUrl = commentsUrl; 161 searchItems.commentsUrl = commentsUrl;
174 } 162 }
175 - final String? issueCommentUrl = 163 + final String? issueCommentUrl = jsonConvert.convert<String>(json['issue_comment_url']);
176 - jsonConvert.convert<String>(json['issue_comment_url']);
177 if (issueCommentUrl != null) { 164 if (issueCommentUrl != null) {
178 searchItems.issueCommentUrl = issueCommentUrl; 165 searchItems.issueCommentUrl = issueCommentUrl;
179 } 166 }
...@@ -193,8 +180,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) { ...@@ -193,8 +180,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) {
193 if (archiveUrl != null) { 180 if (archiveUrl != null) {
194 searchItems.archiveUrl = archiveUrl; 181 searchItems.archiveUrl = archiveUrl;
195 } 182 }
196 - final String? downloadsUrl = 183 + final String? downloadsUrl = jsonConvert.convert<String>(json['downloads_url']);
197 - jsonConvert.convert<String>(json['downloads_url']);
198 if (downloadsUrl != null) { 184 if (downloadsUrl != null) {
199 searchItems.downloadsUrl = downloadsUrl; 185 searchItems.downloadsUrl = downloadsUrl;
200 } 186 }
...@@ -206,13 +192,11 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) { ...@@ -206,13 +192,11 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) {
206 if (pullsUrl != null) { 192 if (pullsUrl != null) {
207 searchItems.pullsUrl = pullsUrl; 193 searchItems.pullsUrl = pullsUrl;
208 } 194 }
209 - final String? milestonesUrl = 195 + final String? milestonesUrl = jsonConvert.convert<String>(json['milestones_url']);
210 - jsonConvert.convert<String>(json['milestones_url']);
211 if (milestonesUrl != null) { 196 if (milestonesUrl != null) {
212 searchItems.milestonesUrl = milestonesUrl; 197 searchItems.milestonesUrl = milestonesUrl;
213 } 198 }
214 - final String? notificationsUrl = 199 + final String? notificationsUrl = jsonConvert.convert<String>(json['notifications_url']);
215 - jsonConvert.convert<String>(json['notifications_url']);
216 if (notificationsUrl != null) { 200 if (notificationsUrl != null) {
217 searchItems.notificationsUrl = notificationsUrl; 201 searchItems.notificationsUrl = notificationsUrl;
218 } 202 }
...@@ -224,8 +208,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) { ...@@ -224,8 +208,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) {
224 if (releasesUrl != null) { 208 if (releasesUrl != null) {
225 searchItems.releasesUrl = releasesUrl; 209 searchItems.releasesUrl = releasesUrl;
226 } 210 }
227 - final String? deploymentsUrl = 211 + final String? deploymentsUrl = jsonConvert.convert<String>(json['deployments_url']);
228 - jsonConvert.convert<String>(json['deployments_url']);
229 if (deploymentsUrl != null) { 212 if (deploymentsUrl != null) {
230 searchItems.deploymentsUrl = deploymentsUrl; 213 searchItems.deploymentsUrl = deploymentsUrl;
231 } 214 }
...@@ -265,8 +248,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) { ...@@ -265,8 +248,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) {
265 if (size != null) { 248 if (size != null) {
266 searchItems.size = size; 249 searchItems.size = size;
267 } 250 }
268 - final int? stargazersCount = 251 + final int? stargazersCount = jsonConvert.convert<int>(json['stargazers_count']);
269 - jsonConvert.convert<int>(json['stargazers_count']);
270 if (stargazersCount != null) { 252 if (stargazersCount != null) {
271 searchItems.stargazersCount = stargazersCount; 253 searchItems.stargazersCount = stargazersCount;
272 } 254 }
...@@ -310,13 +292,11 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) { ...@@ -310,13 +292,11 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) {
310 if (disabled != null) { 292 if (disabled != null) {
311 searchItems.disabled = disabled; 293 searchItems.disabled = disabled;
312 } 294 }
313 - final int? openIssuesCount = 295 + final int? openIssuesCount = jsonConvert.convert<int>(json['open_issues_count']);
314 - jsonConvert.convert<int>(json['open_issues_count']);
315 if (openIssuesCount != null) { 296 if (openIssuesCount != null) {
316 searchItems.openIssuesCount = openIssuesCount; 297 searchItems.openIssuesCount = openIssuesCount;
317 } 298 }
318 - final SearchItemsLicense? license = 299 + final SearchItemsLicense? license = jsonConvert.convert<SearchItemsLicense>(json['license']);
319 - jsonConvert.convert<SearchItemsLicense>(json['license']);
320 if (license != null) { 300 if (license != null) {
321 searchItems.license = license; 301 searchItems.license = license;
322 } 302 }
...@@ -332,8 +312,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) { ...@@ -332,8 +312,7 @@ SearchItems $SearchItemsFromJson(Map<String, dynamic> json) {
332 if (watchers != null) { 312 if (watchers != null) {
333 searchItems.watchers = watchers; 313 searchItems.watchers = watchers;
334 } 314 }
335 - final String? defaultBranch = 315 + final String? defaultBranch = jsonConvert.convert<String>(json['default_branch']);
336 - jsonConvert.convert<String>(json['default_branch']);
337 if (defaultBranch != null) { 316 if (defaultBranch != null) {
338 searchItems.defaultBranch = defaultBranch; 317 searchItems.defaultBranch = defaultBranch;
339 } 318 }
...@@ -452,13 +431,11 @@ SearchItemsOwner $SearchItemsOwnerFromJson(Map<String, dynamic> json) { ...@@ -452,13 +431,11 @@ SearchItemsOwner $SearchItemsOwnerFromJson(Map<String, dynamic> json) {
452 if (htmlUrl != null) { 431 if (htmlUrl != null) {
453 searchItemsOwner.htmlUrl = htmlUrl; 432 searchItemsOwner.htmlUrl = htmlUrl;
454 } 433 }
455 - final String? followersUrl = 434 + final String? followersUrl = jsonConvert.convert<String>(json['followers_url']);
456 - jsonConvert.convert<String>(json['followers_url']);
457 if (followersUrl != null) { 435 if (followersUrl != null) {
458 searchItemsOwner.followersUrl = followersUrl; 436 searchItemsOwner.followersUrl = followersUrl;
459 } 437 }
460 - final String? followingUrl = 438 + final String? followingUrl = jsonConvert.convert<String>(json['following_url']);
461 - jsonConvert.convert<String>(json['following_url']);
462 if (followingUrl != null) { 439 if (followingUrl != null) {
463 searchItemsOwner.followingUrl = followingUrl; 440 searchItemsOwner.followingUrl = followingUrl;
464 } 441 }
...@@ -470,13 +447,11 @@ SearchItemsOwner $SearchItemsOwnerFromJson(Map<String, dynamic> json) { ...@@ -470,13 +447,11 @@ SearchItemsOwner $SearchItemsOwnerFromJson(Map<String, dynamic> json) {
470 if (starredUrl != null) { 447 if (starredUrl != null) {
471 searchItemsOwner.starredUrl = starredUrl; 448 searchItemsOwner.starredUrl = starredUrl;
472 } 449 }
473 - final String? subscriptionsUrl = 450 + final String? subscriptionsUrl = jsonConvert.convert<String>(json['subscriptions_url']);
474 - jsonConvert.convert<String>(json['subscriptions_url']);
475 if (subscriptionsUrl != null) { 451 if (subscriptionsUrl != null) {
476 searchItemsOwner.subscriptionsUrl = subscriptionsUrl; 452 searchItemsOwner.subscriptionsUrl = subscriptionsUrl;
477 } 453 }
478 - final String? organizationsUrl = 454 + final String? organizationsUrl = jsonConvert.convert<String>(json['organizations_url']);
479 - jsonConvert.convert<String>(json['organizations_url']);
480 if (organizationsUrl != null) { 455 if (organizationsUrl != null) {
481 searchItemsOwner.organizationsUrl = organizationsUrl; 456 searchItemsOwner.organizationsUrl = organizationsUrl;
482 } 457 }
...@@ -488,8 +463,7 @@ SearchItemsOwner $SearchItemsOwnerFromJson(Map<String, dynamic> json) { ...@@ -488,8 +463,7 @@ SearchItemsOwner $SearchItemsOwnerFromJson(Map<String, dynamic> json) {
488 if (eventsUrl != null) { 463 if (eventsUrl != null) {
489 searchItemsOwner.eventsUrl = eventsUrl; 464 searchItemsOwner.eventsUrl = eventsUrl;
490 } 465 }
491 - final String? receivedEventsUrl = 466 + final String? receivedEventsUrl = jsonConvert.convert<String>(json['received_events_url']);
492 - jsonConvert.convert<String>(json['received_events_url']);
493 if (receivedEventsUrl != null) { 467 if (receivedEventsUrl != null) {
494 searchItemsOwner.receivedEventsUrl = receivedEventsUrl; 468 searchItemsOwner.receivedEventsUrl = receivedEventsUrl;
495 } 469 }
......
1 +import 'dart:convert';
2 +import 'package:one_poem/generated/json/base/json_field.dart';
3 +import 'package:one_poem/generated/json/lang_sort_entity.g.dart';
4 +
5 +@JsonSerializable()
6 +class LangSortEntity {
7 +
8 + String? id;
9 + String? name;
10 +
11 + LangSortEntity();
12 +
13 + factory LangSortEntity.fromJson(Map<String, dynamic> json) => $LangSortEntityFromJson(json);
14 +
15 + Map<String, dynamic> toJson() => $LangSortEntityToJson(this);
16 +
17 + @override
18 + String toString() {
19 + return jsonEncode(this);
20 + }
21 +}
...\ No newline at end of file ...\ No newline at end of file
1 import 'package:flutter/cupertino.dart'; 1 import 'package:flutter/cupertino.dart';
2 import 'package:flutter/material.dart'; 2 import 'package:flutter/material.dart';
3 +import 'package:one_poem/poem/provider/lang_sort_provider.dart';
4 +import 'package:one_poem/poem/widgets/lang_sort_bottom_sheet.dart';
3 import 'package:one_poem/res/resources.dart'; 5 import 'package:one_poem/res/resources.dart';
4 import 'package:one_poem/routers/fluro_navigator.dart'; 6 import 'package:one_poem/routers/fluro_navigator.dart';
5 import 'package:one_poem/routers/routers.dart'; 7 import 'package:one_poem/routers/routers.dart';
8 +import 'package:one_poem/widgets/click_item.dart';
6 import 'package:one_poem/widgets/my_app_bar.dart'; 9 import 'package:one_poem/widgets/my_app_bar.dart';
7 10
8 import 'package:one_poem/extension/int_extension.dart'; 11 import 'package:one_poem/extension/int_extension.dart';
...@@ -19,6 +22,9 @@ class PoemPublish extends StatefulWidget { ...@@ -19,6 +22,9 @@ class PoemPublish extends StatefulWidget {
19 22
20 class _PoemPublishState extends State<PoemPublish> { 23 class _PoemPublishState extends State<PoemPublish> {
21 bool isPublishing = false; 24 bool isPublishing = false;
25 + String _langSortName = "普通话";
26 + int _langSortId = 1;
27 + final LangSortProvider _provider = LangSortProvider();
22 28
23 @override 29 @override
24 void initState() { 30 void initState() {
...@@ -28,6 +34,7 @@ class _PoemPublishState extends State<PoemPublish> { ...@@ -28,6 +34,7 @@ class _PoemPublishState extends State<PoemPublish> {
28 @override 34 @override
29 void dispose() { 35 void dispose() {
30 super.dispose(); 36 super.dispose();
37 + _provider.dispose();
31 } 38 }
32 39
33 @override 40 @override
...@@ -94,7 +101,25 @@ class _PoemPublishState extends State<PoemPublish> { ...@@ -94,7 +101,25 @@ class _PoemPublishState extends State<PoemPublish> {
94 ], 101 ],
95 ), 102 ),
96 ), 103 ),
97 - Container( 104 + InkWell(
105 + onTap: () {
106 + showModalBottomSheet<void>(
107 + context: context,
108 + isScrollControlled: true,
109 + builder: (BuildContext context) {
110 + return LangSortBottomSheet(
111 + provider: _provider,
112 + onSelected: (id, name) {
113 + setState(() {
114 + _langSortId = int.parse(id);
115 + _langSortName = name;
116 + });
117 + },
118 + );
119 + },
120 + );
121 + },
122 + child: Container(
98 padding: EdgeInsets.all(10.px), 123 padding: EdgeInsets.all(10.px),
99 alignment: Alignment.centerLeft, 124 alignment: Alignment.centerLeft,
100 width: double.infinity, 125 width: double.infinity,
...@@ -106,18 +131,14 @@ class _PoemPublishState extends State<PoemPublish> { ...@@ -106,18 +131,14 @@ class _PoemPublishState extends State<PoemPublish> {
106 size: 15.px, 131 size: 15.px,
107 ), 132 ),
108 Gaps.hGap5, 133 Gaps.hGap5,
109 - const Text( 134 + Text(
110 - "所用口音", 135 + "所用口音 $_langSortName",
111 - style: TextStyle(color: Colors.black45), 136 + style: const TextStyle(color: Colors.black45),
112 - ),
113 - Gaps.hGap10,
114 - const Text(
115 - "普通话",
116 - style: TextStyle(color: Colors.black45),
117 ), 137 ),
118 ], 138 ],
119 ), 139 ),
120 ), 140 ),
141 + ),
121 const Spacer(), 142 const Spacer(),
122 Expanded( 143 Expanded(
123 child: Center( 144 child: Center(
......
1 +import 'dart:convert';
2 +
3 +import 'package:flutter/material.dart';
4 +import 'package:flutter/services.dart';
5 +import 'package:one_poem/generated/json/base/json_convert_content.dart';
6 +import 'package:one_poem/poem/models/lang_sort_entity.dart';
7 +
8 +class LangSortProvider extends ChangeNotifier {
9 + int _index = 0;
10 + int get index => _index;
11 + List<LangSortEntity> _mLangSort = [];
12 +
13 + /// 当前列表数据
14 + List<LangSortEntity> _mList = [];
15 + List<LangSortEntity> get mList => _mList;
16 +
17 + /// 三级联动选择的position
18 + final List<int> _positions = [0];
19 + List<int> get positions => _positions;
20 +
21 + void setIndex(int index) {
22 + _index = index;
23 + notifyListeners();
24 + }
25 +
26 + void indexIncrement() {
27 + _index++;
28 + }
29 +
30 + void setList(int index) {
31 + switch (index) {
32 + case 0:
33 + _mList = _mLangSort;
34 + break;
35 + }
36 + }
37 +
38 + void initData() {
39 + if (_mList.isNotEmpty) {
40 + return;
41 + }
42 + rootBundle.loadString('assets/data/lang.json').then((String value) {
43 + _mLangSort =
44 + JsonConvert.fromJsonAsT<List<LangSortEntity>>(json.decode(value)) ??
45 + [];
46 + _mList = _mLangSort;
47 + notifyListeners();
48 + });
49 + }
50 +}
1 +import 'package:flutter/material.dart';
2 +import 'package:one_poem/poem/provider/lang_sort_provider.dart';
3 +import 'package:one_poem/res/resources.dart';
4 +import 'package:one_poem/routers/fluro_navigator.dart';
5 +import 'package:provider/provider.dart';
6 +import 'package:one_poem/util/screen_utils.dart';
7 +
8 +class LangSortBottomSheet extends StatefulWidget {
9 + const LangSortBottomSheet({
10 + Key? key,
11 + required this.provider,
12 + required this.onSelected,
13 + }) : super(key: key);
14 +
15 + final Function(String, String) onSelected;
16 +
17 + /// 临时状态
18 + final LangSortProvider provider;
19 +
20 + @override
21 + LangSortBottomSheetState createState() => LangSortBottomSheetState();
22 +}
23 +
24 +class LangSortBottomSheetState extends State<LangSortBottomSheet>
25 + with SingleTickerProviderStateMixin {
26 + final ScrollController _controller = ScrollController();
27 +
28 + @override
29 + void initState() {
30 + super.initState();
31 + WidgetsBinding.instance!.addPostFrameCallback((_) {
32 + widget.provider.initData();
33 + });
34 + }
35 +
36 + @override
37 + void dispose() {
38 + _controller.dispose();
39 + super.dispose();
40 + }
41 +
42 + @override
43 + Widget build(BuildContext context) {
44 + return Material(
45 + child: SizedBox(
46 + height: context.height * 11.0 / 16.0,
47 +
48 + /// 为保留状态,选择ChangeNotifierProvider.value,销毁自己手动处理(见 goods_edit_page.dart :dispose())
49 + child: ChangeNotifierProvider<LangSortProvider>.value(
50 + value: widget.provider,
51 + child: Consumer<LangSortProvider>(
52 + builder: (_, provider, child) {
53 + return Column(
54 + crossAxisAlignment: CrossAxisAlignment.start,
55 + children: <Widget>[
56 + child!,
57 + Gaps.line,
58 + Expanded(
59 + child: ListView.builder(
60 + controller: _controller,
61 + itemExtent: 48.0,
62 + itemBuilder: (_, index) {
63 + return _buildItem(provider, index);
64 + },
65 + itemCount: provider.mList.length,
66 + ),
67 + )
68 + ],
69 + );
70 + },
71 + child: Stack(
72 + children: <Widget>[
73 + Container(
74 + width: double.infinity,
75 + alignment: Alignment.center,
76 + padding: const EdgeInsets.symmetric(vertical: 16.0),
77 + child: const Text(
78 + '请选择口音',
79 + style: TextStyles.textBold16,
80 + ),
81 + ),
82 + Positioned(
83 + right: 16.0,
84 + top: 16.0,
85 + bottom: 16.0,
86 + child: InkWell(
87 + onTap: () => NavigatorUtils.goBack(context),
88 + child: const SizedBox(
89 + height: 16.0,
90 + width: 16.0,
91 + child: Icon(Icons.close),
92 + ),
93 + ),
94 + )
95 + ],
96 + ),
97 + ),
98 + ),
99 + ),
100 + );
101 + }
102 +
103 + Widget _buildItem(LangSortProvider provider, int index) {
104 + return InkWell(
105 + child: Container(
106 + padding: const EdgeInsets.symmetric(horizontal: 16.0),
107 + alignment: Alignment.centerLeft,
108 + child: Row(
109 + children: <Widget>[
110 + Text(
111 + provider.mList[index].name!,
112 + style: const TextStyle(
113 + fontSize: Dimens.font_sp14,
114 + color: Colors.black45,
115 + ),
116 + ),
117 + ],
118 + ),
119 + ),
120 + onTap: () {
121 + widget.onSelected(
122 + provider.mList[index].id!, provider.mList[index].name!);
123 + NavigatorUtils.goBack(context);
124 + _controller.animateTo(
125 + 0.0,
126 + duration: const Duration(milliseconds: 100),
127 + curve: Curves.ease,
128 + );
129 + },
130 + );
131 + }
132 +}