Showing
14 changed files
with
327 additions
and
573 deletions
assets/data/data/bank.json
deleted
100644 → 0
| 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 |
assets/data/data/bank_2.json
deleted
100644 → 0
| 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 |
assets/data/data/city.json
deleted
100644 → 0
This diff is collapsed. Click to expand it.
assets/data/data/sort_0.json
deleted
100644 → 0
| 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 |
assets/data/data/sort_1.json
deleted
100644 → 0
| 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 |
assets/data/data/sort_2.json
deleted
100644 → 0
| 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 |
assets/data/lang.json
0 → 100644
| 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 | } | ... | ... |
lib/generated/json/lang_sort_entity.g.dart
0 → 100644
| 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 |
This diff is collapsed. Click to expand it.
lib/poem/models/lang_sort_entity.dart
0 → 100644
| 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,28 +101,42 @@ class _PoemPublishState extends State<PoemPublish> { | ... | @@ -94,28 +101,42 @@ class _PoemPublishState extends State<PoemPublish> { |
| 94 | ], | 101 | ], |
| 95 | ), | 102 | ), |
| 96 | ), | 103 | ), |
| 97 | - Container( | 104 | + InkWell( |
| 98 | - padding: EdgeInsets.all(10.px), | 105 | + onTap: () { |
| 99 | - alignment: Alignment.centerLeft, | 106 | + showModalBottomSheet<void>( |
| 100 | - width: double.infinity, | 107 | + context: context, |
| 101 | - height: 36.px, | 108 | + isScrollControlled: true, |
| 102 | - child: Wrap( | 109 | + builder: (BuildContext context) { |
| 103 | - children: [ | 110 | + return LangSortBottomSheet( |
| 104 | - Icon( | 111 | + provider: _provider, |
| 105 | - Icons.record_voice_over_outlined, | 112 | + onSelected: (id, name) { |
| 106 | - size: 15.px, | 113 | + setState(() { |
| 107 | - ), | 114 | + _langSortId = int.parse(id); |
| 108 | - Gaps.hGap5, | 115 | + _langSortName = name; |
| 109 | - const Text( | 116 | + }); |
| 110 | - "所用口音", | 117 | + }, |
| 111 | - style: TextStyle(color: Colors.black45), | 118 | + ); |
| 112 | - ), | 119 | + }, |
| 113 | - Gaps.hGap10, | 120 | + ); |
| 114 | - const Text( | 121 | + }, |
| 115 | - "普通话", | 122 | + child: Container( |
| 116 | - style: TextStyle(color: Colors.black45), | 123 | + padding: EdgeInsets.all(10.px), |
| 117 | - ), | 124 | + alignment: Alignment.centerLeft, |
| 118 | - ], | 125 | + width: double.infinity, |
| 126 | + height: 36.px, | ||
| 127 | + child: Wrap( | ||
| 128 | + children: [ | ||
| 129 | + Icon( | ||
| 130 | + Icons.record_voice_over_outlined, | ||
| 131 | + size: 15.px, | ||
| 132 | + ), | ||
| 133 | + Gaps.hGap5, | ||
| 134 | + Text( | ||
| 135 | + "所用口音 $_langSortName", | ||
| 136 | + style: const TextStyle(color: Colors.black45), | ||
| 137 | + ), | ||
| 138 | + ], | ||
| 139 | + ), | ||
| 119 | ), | 140 | ), |
| 120 | ), | 141 | ), |
| 121 | const Spacer(), | 142 | const Spacer(), | ... | ... |
lib/poem/provider/lang_sort_provider.dart
0 → 100644
| 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 | +} |
lib/poem/widgets/lang_sort_bottom_sheet.dart
0 → 100644
| 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 | +} |
-
Please register or login to post a comment