Commit b7c6b3ba83ed5f30e5d30ab85e3341ed971b6d2e

Authored by wdn127929
1 parent 744f2ec5

设置菜单主题色UI

@@ -21,6 +21,7 @@ import 'package:one_key/widgets/v_empty_view.dart'; @@ -21,6 +21,7 @@ import 'package:one_key/widgets/v_empty_view.dart';
21 import 'package:provider/provider.dart'; 21 import 'package:provider/provider.dart';
22 import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; 22 import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
23 23
  24 +import '../../../models/theme_color_model.dart';
24 import '../../../utils/screen_util.dart'; 25 import '../../../utils/screen_util.dart';
25 26
26 class MenuManagePage extends StatefulWidget { 27 class MenuManagePage extends StatefulWidget {
@@ -34,9 +35,13 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -34,9 +35,13 @@ class _MenuManagePageState extends State<MenuManagePage> {
34 ScrollController _controller = ScrollController(); 35 ScrollController _controller = ScrollController();
35 MenuManageProvider menuManageProvider; 36 MenuManageProvider menuManageProvider;
36 bool isShow = false; //添加菜品按钮 37 bool isShow = false; //添加菜品按钮
  38 +
  39 + List<ThemeColorModel> themeColorData = [];
  40 + ThemeColorModel themeColerModel1;
37 @override 41 @override
38 void initState() { 42 void initState() {
39 super.initState(); 43 super.initState();
  44 + _initThemeColor();
40 WidgetsBinding.instance.addPostFrameCallback((timeStamp) { 45 WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
41 _getCookbookByClass(showLoading: false); 46 _getCookbookByClass(showLoading: false);
42 _getCookbookBySellerId(); 47 _getCookbookBySellerId();
@@ -54,6 +59,47 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -54,6 +59,47 @@ class _MenuManagePageState extends State<MenuManagePage> {
54 EventBus().off('menu_manage_page'); 59 EventBus().off('menu_manage_page');
55 } 60 }
56 61
  62 + ///初始化主题颜色
  63 + _initThemeColor() {
  64 + // int colorValue = App.sp.get("themeColor");
  65 +
  66 + // if (colorValue != null) {
  67 + // //缓存里有设置好的主题色
  68 + // if (colorValue == MyColours.color_0C0F0E.value) {
  69 + // themeColorIndex = 0;
  70 + // } else if (colorValue == MyColours.color_0143A3.value) {
  71 + // themeColorIndex = 1;
  72 + // } else if (colorValue == MyColours.color_438E93.value) {
  73 + // themeColorIndex = 2;
  74 + // }
  75 + // }
  76 + ThemeColorModel colorModel = ThemeColorModel();
  77 + colorModel.name = '睿智灰';
  78 + colorModel.color = MyColours.color_4D4E50;
  79 + themeColorData.add(colorModel);
  80 +
  81 + ThemeColorModel colorModel1 = ThemeColorModel();
  82 + colorModel1.name = '珍珠白';
  83 + colorModel1.color = MyColours.color_FBF6F1;
  84 + themeColorData.add(colorModel1);
  85 +
  86 + ThemeColorModel colorModel2 = ThemeColorModel();
  87 + colorModel2.name = '国风库金';
  88 + colorModel2.color = MyColours.color_877952;
  89 + themeColorData.add(colorModel2);
  90 +
  91 + ThemeColorModel colorModel3 = ThemeColorModel();
  92 + colorModel3.name = '群青绿';
  93 + colorModel3.color = MyColours.color_438E93;
  94 + themeColorData.add(colorModel3);
  95 +
  96 + ThemeColorModel colorModel4 = ThemeColorModel();
  97 + colorModel4.name = '国风绿';
  98 + colorModel4.color = MyColours.color_3E6F51;
  99 + themeColorData.add(colorModel4);
  100 + themeColerModel1 = themeColorData[4];
  101 + }
  102 +
57 ///获取分类数据 103 ///获取分类数据
58 _getCookbookBySellerId({bool showLoading = true}) async { 104 _getCookbookBySellerId({bool showLoading = true}) async {
59 Map<String, String> params = { 105 Map<String, String> params = {
@@ -165,10 +211,10 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -165,10 +211,10 @@ class _MenuManagePageState extends State<MenuManagePage> {
165 style: TextStyle( 211 style: TextStyle(
166 fontWeight: FontWeight.bold, 212 fontWeight: FontWeight.bold,
167 fontSize: font(20), 213 fontSize: font(20),
168 - color: MyColours.color_DBDBDB, 214 + color: MyColours.color_515151,
169 shadows: [ 215 shadows: [
170 BoxShadow( 216 BoxShadow(
171 - color: MyColours.color_000000, 217 + color: MyColours.color_FBF6F1,
172 offset: Offset(0, 1), 218 offset: Offset(0, 1),
173 blurRadius: w(2), 219 blurRadius: w(2),
174 spreadRadius: w(20)) 220 spreadRadius: w(20))
@@ -176,8 +222,17 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -176,8 +222,17 @@ class _MenuManagePageState extends State<MenuManagePage> {
176 ), 222 ),
177 VEmptyView(20), 223 VEmptyView(20),
178 Text('味型:咸鲜 烹调:熬煮', 224 Text('味型:咸鲜 烹调:熬煮',
179 - style:  
180 - TextStyle(fontSize: font(12), color: MyColours.color_DBDBDB)), 225 + style: TextStyle(
  226 + fontWeight: FontWeight.bold,
  227 + fontSize: font(12),
  228 + color: MyColours.color_515151,
  229 + shadows: [
  230 + BoxShadow(
  231 + color: MyColours.color_FBF6F1,
  232 + offset: Offset(0, 1),
  233 + blurRadius: w(2),
  234 + spreadRadius: w(20))
  235 + ])),
181 VEmptyView(20), 236 VEmptyView(20),
182 Text( 237 Text(
183 '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ', 238 '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ',
@@ -185,10 +240,10 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -185,10 +240,10 @@ class _MenuManagePageState extends State<MenuManagePage> {
185 style: TextStyle( 240 style: TextStyle(
186 fontWeight: FontWeight.bold, 241 fontWeight: FontWeight.bold,
187 fontSize: font(14), 242 fontSize: font(14),
188 - color: MyColours.color_DBDBDB, 243 + color: MyColours.color_515151,
189 shadows: [ 244 shadows: [
190 BoxShadow( 245 BoxShadow(
191 - color: MyColours.color_000000, 246 + color: MyColours.color_FBF6F1,
192 offset: Offset(0, 1), 247 offset: Offset(0, 1),
193 blurRadius: w(2), 248 blurRadius: w(2),
194 spreadRadius: w(20)) 249 spreadRadius: w(20))
@@ -210,10 +265,10 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -210,10 +265,10 @@ class _MenuManagePageState extends State<MenuManagePage> {
210 style: TextStyle( 265 style: TextStyle(
211 fontWeight: FontWeight.bold, 266 fontWeight: FontWeight.bold,
212 fontSize: font(20), 267 fontSize: font(20),
213 - color: MyColours.color_DBDBDB, 268 + color: MyColours.color_515151,
214 shadows: [ 269 shadows: [
215 BoxShadow( 270 BoxShadow(
216 - color: MyColours.color_000000, 271 + color: MyColours.color_FBF6F1,
217 offset: Offset(0, 1), 272 offset: Offset(0, 1),
218 blurRadius: w(2), 273 blurRadius: w(2),
219 spreadRadius: w(20)) 274 spreadRadius: w(20))
@@ -222,7 +277,17 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -222,7 +277,17 @@ class _MenuManagePageState extends State<MenuManagePage> {
222 VEmptyView(20), 277 VEmptyView(20),
223 Text('味型:咸鲜 烹调:熬煮', 278 Text('味型:咸鲜 烹调:熬煮',
224 style: 279 style:
225 - TextStyle(fontSize: font(12), color: MyColours.color_DBDBDB)), 280 + TextStyle(
  281 + fontWeight: FontWeight.bold,
  282 + fontSize: font(12),
  283 + color: MyColours.color_515151,
  284 + shadows: [
  285 + BoxShadow(
  286 + color: MyColours.color_FBF6F1,
  287 + offset: Offset(0, 1),
  288 + blurRadius: w(2),
  289 + spreadRadius: w(20))
  290 + ])),
226 VEmptyView(20), 291 VEmptyView(20),
227 Text( 292 Text(
228 '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ', 293 '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ',
@@ -230,10 +295,10 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -230,10 +295,10 @@ class _MenuManagePageState extends State<MenuManagePage> {
230 style: TextStyle( 295 style: TextStyle(
231 fontWeight: FontWeight.bold, 296 fontWeight: FontWeight.bold,
232 fontSize: font(14), 297 fontSize: font(14),
233 - color: MyColours.color_DBDBDB, 298 + color: MyColours.color_515151,
234 shadows: [ 299 shadows: [
235 BoxShadow( 300 BoxShadow(
236 - color: MyColours.color_000000, 301 + color: MyColours.color_FBF6F1,
237 offset: Offset(0, 1), 302 offset: Offset(0, 1),
238 blurRadius: w(2), 303 blurRadius: w(2),
239 spreadRadius: w(20)) 304 spreadRadius: w(20))
@@ -260,10 +325,10 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -260,10 +325,10 @@ class _MenuManagePageState extends State<MenuManagePage> {
260 style: TextStyle( 325 style: TextStyle(
261 fontWeight: FontWeight.bold, 326 fontWeight: FontWeight.bold,
262 fontSize: font(20), 327 fontSize: font(20),
263 - color: MyColours.color_DBDBDB, 328 + color: MyColours.color_515151,
264 shadows: [ 329 shadows: [
265 BoxShadow( 330 BoxShadow(
266 - color: MyColours.color_000000, 331 + color: MyColours.color_FBF6F1,
267 offset: Offset(0, 1), 332 offset: Offset(0, 1),
268 blurRadius: w(2), 333 blurRadius: w(2),
269 spreadRadius: w(20)) 334 spreadRadius: w(20))
@@ -272,7 +337,16 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -272,7 +337,16 @@ class _MenuManagePageState extends State<MenuManagePage> {
272 VEmptyView(20), 337 VEmptyView(20),
273 Text('味型:咸鲜 烹调:熬煮', 338 Text('味型:咸鲜 烹调:熬煮',
274 style: TextStyle( 339 style: TextStyle(
275 - fontSize: font(12), color: MyColours.color_DBDBDB)) 340 + fontWeight: FontWeight.bold,
  341 + fontSize: font(12),
  342 + color: MyColours.color_515151,
  343 + shadows: [
  344 + BoxShadow(
  345 + color: MyColours.color_FBF6F1,
  346 + offset: Offset(0, 1),
  347 + blurRadius: w(2),
  348 + spreadRadius: w(20))
  349 + ]))
276 ], 350 ],
277 ), 351 ),
278 ), 352 ),
@@ -283,10 +357,10 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -283,10 +357,10 @@ class _MenuManagePageState extends State<MenuManagePage> {
283 style: TextStyle( 357 style: TextStyle(
284 fontWeight: FontWeight.bold, 358 fontWeight: FontWeight.bold,
285 fontSize: font(14), 359 fontSize: font(14),
286 - color: MyColours.color_DBDBDB, 360 + color: MyColours.color_515151,
287 shadows: [ 361 shadows: [
288 BoxShadow( 362 BoxShadow(
289 - color: MyColours.color_000000, 363 + color: MyColours.color_FBF6F1,
290 offset: Offset(0, 1), 364 offset: Offset(0, 1),
291 blurRadius: w(2), 365 blurRadius: w(2),
292 spreadRadius: w(20)) 366 spreadRadius: w(20))
@@ -296,10 +370,10 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -296,10 +370,10 @@ class _MenuManagePageState extends State<MenuManagePage> {
296 ); 370 );
297 } 371 }
298 372
299 - Widget _smallMenu(MenuSunModel model) { 373 + Widget _smallMenu(MenuSunModel model, ThemeColorModel themeColerModel) {
300 return Container( 374 return Container(
301 width: ScreenUtil().screenWidth / 2, 375 width: ScreenUtil().screenWidth / 2,
302 - color: MyColours.color_4D4E50, 376 + color: themeColerModel.color,
303 child: Column( 377 child: Column(
304 crossAxisAlignment: CrossAxisAlignment.start, 378 crossAxisAlignment: CrossAxisAlignment.start,
305 children: [ 379 children: [
@@ -311,10 +385,10 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -311,10 +385,10 @@ class _MenuManagePageState extends State<MenuManagePage> {
311 style: TextStyle( 385 style: TextStyle(
312 fontWeight: FontWeight.bold, 386 fontWeight: FontWeight.bold,
313 fontSize: font(20), 387 fontSize: font(20),
314 - color: MyColours.color_DBDBDB, 388 + color: MyColours.color_515151,
315 shadows: [ 389 shadows: [
316 BoxShadow( 390 BoxShadow(
317 - color: MyColours.color_000000, 391 + color: MyColours.color_FBF6F1,
318 offset: Offset(0, 1), 392 offset: Offset(0, 1),
319 blurRadius: w(2), 393 blurRadius: w(2),
320 spreadRadius: w(20)) 394 spreadRadius: w(20))
@@ -323,9 +397,20 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -323,9 +397,20 @@ class _MenuManagePageState extends State<MenuManagePage> {
323 VEmptyView(20), 397 VEmptyView(20),
324 Padding( 398 Padding(
325 padding: EdgeInsets.symmetric(horizontal: w(10)), 399 padding: EdgeInsets.symmetric(horizontal: w(10)),
326 - child: Text('味型:咸鲜 烹调:熬煮',  
327 - style: TextStyle(  
328 - fontSize: font(12), color: MyColours.color_DBDBDB))), 400 + child: Text(
  401 + '味型:咸鲜 烹调:熬煮',
  402 + style: TextStyle(
  403 + fontWeight: FontWeight.bold,
  404 + fontSize: font(12),
  405 + color: MyColours.color_515151,
  406 + shadows: [
  407 + BoxShadow(
  408 + color: MyColours.color_FBF6F1,
  409 + offset: Offset(0, 1),
  410 + blurRadius: w(2),
  411 + spreadRadius: w(20))
  412 + ]),
  413 + )),
329 VEmptyView(20), 414 VEmptyView(20),
330 Padding( 415 Padding(
331 padding: EdgeInsets.symmetric(horizontal: w(10)), 416 padding: EdgeInsets.symmetric(horizontal: w(10)),
@@ -335,10 +420,10 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -335,10 +420,10 @@ class _MenuManagePageState extends State<MenuManagePage> {
335 style: TextStyle( 420 style: TextStyle(
336 fontWeight: FontWeight.bold, 421 fontWeight: FontWeight.bold,
337 fontSize: font(14), 422 fontSize: font(14),
338 - color: MyColours.color_DBDBDB, 423 + color: MyColours.color_515151,
339 shadows: [ 424 shadows: [
340 BoxShadow( 425 BoxShadow(
341 - color: MyColours.color_000000, 426 + color: MyColours.color_FBF6F1,
342 offset: Offset(0, 1), 427 offset: Offset(0, 1),
343 blurRadius: w(2), 428 blurRadius: w(2),
344 spreadRadius: w(20)) 429 spreadRadius: w(20))
@@ -358,7 +443,10 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -358,7 +443,10 @@ class _MenuManagePageState extends State<MenuManagePage> {
358 child: Text( 443 child: Text(
359 '江南传统名菜,口味咸鲜,汤白汁浓,肉质酥肥,笋清香脆嫩,鲜味浓厚。', 444 '江南传统名菜,口味咸鲜,汤白汁浓,肉质酥肥,笋清香脆嫩,鲜味浓厚。',
360 style: TextStyle( 445 style: TextStyle(
361 - color: MyColours.color_DBDBDB, fontSize: font(12)), 446 + color: themeColerModel.name == '珍珠白'
  447 + ? MyColours.color_515151
  448 + : MyColours.color_FBF6F1,
  449 + fontSize: font(12)),
362 ), 450 ),
363 ), 451 ),
364 Align( 452 Align(
@@ -367,7 +455,7 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -367,7 +455,7 @@ class _MenuManagePageState extends State<MenuManagePage> {
367 padding: 455 padding:
368 EdgeInsets.only(right: w(20), top: w(19), bottom: w(19)), 456 EdgeInsets.only(right: w(20), top: w(19), bottom: w(19)),
369 child: Image.asset( 457 child: Image.asset(
370 - Utils.getImgPath('add_area'), 458 + Utils.getImgPath('add_store'),
371 width: w(22), 459 width: w(22),
372 ), 460 ),
373 )), 461 )),
@@ -395,7 +483,7 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -395,7 +483,7 @@ class _MenuManagePageState extends State<MenuManagePage> {
395 model.imageType = null; 483 model.imageType = null;
396 } 484 }
397 if (object['move'] != null) { 485 if (object['move'] != null) {
398 - if (object['move'] == '1') { 486 + if (object['move'] == '1' && model.indexNew != 0) {
399 //向上移动 487 //向上移动
400 488
401 var child = menuManageProvider.menuModel[indexOut].cookbooklist 489 var child = menuManageProvider.menuModel[indexOut].cookbooklist
@@ -405,7 +493,10 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -405,7 +493,10 @@ class _MenuManagePageState extends State<MenuManagePage> {
405 .insert(model.indexNew - 1, child); 493 .insert(model.indexNew - 1, child);
406 494
407 _handleData(isMove: true); 495 _handleData(isMove: true);
408 - } else if (object['move'] == '2') { 496 + } else if (object['move'] == '2' &&
  497 + model.indexNew !=
  498 + menuManageProvider.menuModel[indexOut].cookbooklist.length -
  499 + 1) {
409 //向下移动 500 //向下移动
410 var child = menuManageProvider.menuModel[indexOut].cookbooklist 501 var child = menuManageProvider.menuModel[indexOut].cookbooklist
411 .removeAt(model.indexNew); 502 .removeAt(model.indexNew);
@@ -415,9 +506,10 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -415,9 +506,10 @@ class _MenuManagePageState extends State<MenuManagePage> {
415 506
416 _handleData(isMove: true); 507 _handleData(isMove: true);
417 } 508 }
  509 + } else {
  510 + _handleData();
418 } 511 }
419 } 512 }
420 - ;  
421 } 513 }
422 514
423 @override 515 @override
@@ -431,6 +523,11 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -431,6 +523,11 @@ class _MenuManagePageState extends State<MenuManagePage> {
431 EventBus().emit('changeStatusColor'); 523 EventBus().emit('changeStatusColor');
432 Navigator.of(context).pop(); 524 Navigator.of(context).pop();
433 }, 525 },
  526 + rightImgName: 'set_g.png',
  527 + onTapRight: () {
  528 + NavigatorUtil.goMenuThemeColorSetPage(
  529 + context, {'object': menuManageProvider.menuModel});
  530 + },
434 ), 531 ),
435 body: WillPopScope( 532 body: WillPopScope(
436 onWillPop: () { 533 onWillPop: () {
@@ -457,7 +554,7 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -457,7 +554,7 @@ class _MenuManagePageState extends State<MenuManagePage> {
457 )) 554 ))
458 : Expanded( 555 : Expanded(
459 child: Container( 556 child: Container(
460 - color: MyColours.color_4D4E50, 557 + color: MyColours.color_ffffff,
461 padding: EdgeInsets.symmetric(horizontal: w(20)), 558 padding: EdgeInsets.symmetric(horizontal: w(20)),
462 child: Column( 559 child: Column(
463 crossAxisAlignment: CrossAxisAlignment.start, 560 crossAxisAlignment: CrossAxisAlignment.start,
@@ -467,7 +564,7 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -467,7 +564,7 @@ class _MenuManagePageState extends State<MenuManagePage> {
467 '您还没有创建菜谱,建议按照如下顺序创建店铺专属菜谱:\n1、点击分类管理创建菜谱分类,如热菜、凉菜等;\n2、点击添加菜品,创建菜品;\n3、在菜品列表中,长按菜品,可以配置菜品显示方式。\n', 564 '您还没有创建菜谱,建议按照如下顺序创建店铺专属菜谱:\n1、点击分类管理创建菜谱分类,如热菜、凉菜等;\n2、点击添加菜品,创建菜品;\n3、在菜品列表中,长按菜品,可以配置菜品显示方式。\n',
468 style: TextStyle( 565 style: TextStyle(
469 height: 1.3, 566 height: 1.3,
470 - color: MyColours.color_DBDBDB, 567 + color: MyColours.color_515151,
471 fontSize: font(16), 568 fontSize: font(16),
472 fontWeight: FontWeight.bold), 569 fontWeight: FontWeight.bold),
473 ), 570 ),
@@ -476,7 +573,7 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -476,7 +573,7 @@ class _MenuManagePageState extends State<MenuManagePage> {
476 '赶快来创建您的专业菜谱吧!', 573 '赶快来创建您的专业菜谱吧!',
477 style: TextStyle( 574 style: TextStyle(
478 height: 1.3, 575 height: 1.3,
479 - color: MyColours.color_DBDBDB, 576 + color: MyColours.color_515151,
480 fontSize: font(16), 577 fontSize: font(16),
481 fontWeight: FontWeight.bold), 578 fontWeight: FontWeight.bold),
482 ), 579 ),
@@ -547,11 +644,15 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -547,11 +644,15 @@ class _MenuManagePageState extends State<MenuManagePage> {
547 shrinkWrap: true, 644 shrinkWrap: true,
548 controller: _controller, 645 controller: _controller,
549 itemBuilder: (BuildContext context, int indexOut) { 646 itemBuilder: (BuildContext context, int indexOut) {
  647 + Color classNameColor =
  648 + themeColerModel1.name == '珍珠白'
  649 + ? MyColours.color_515151
  650 + : MyColours.color_FBF6F1;
550 return Column( 651 return Column(
551 children: [ 652 children: [
552 Container( 653 Container(
553 height: w(32), 654 height: w(32),
554 - color: MyColours.color_4D4E50, 655 + color: themeColerModel1.color,
555 margin: EdgeInsets.only(bottom: (w(2))), 656 margin: EdgeInsets.only(bottom: (w(2))),
556 child: Row( 657 child: Row(
557 mainAxisAlignment: 658 mainAxisAlignment:
@@ -561,30 +662,30 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -561,30 +662,30 @@ class _MenuManagePageState extends State<MenuManagePage> {
561 width: ScreenUtil().setWidth(10), 662 width: ScreenUtil().setWidth(10),
562 height: ScreenUtil().setWidth(10), 663 height: ScreenUtil().setWidth(10),
563 decoration: BoxDecoration( 664 decoration: BoxDecoration(
564 - color: MyColours.color_DBDBDB, 665 + color: classNameColor,
565 shape: BoxShape.circle), 666 shape: BoxShape.circle),
566 ), 667 ),
567 MyDivider(ScreenUtil().setWidth(80), 668 MyDivider(ScreenUtil().setWidth(80),
568 ScreenUtil().setWidth(2), 669 ScreenUtil().setWidth(2),
569 - color: MyColours.color_DBDBDB), 670 + color: classNameColor),
570 HEmptyView(20), 671 HEmptyView(20),
571 Text( 672 Text(
572 menuManageProvider 673 menuManageProvider
573 .menuModel[indexOut].className, 674 .menuModel[indexOut].className,
574 style: TextStyle( 675 style: TextStyle(
575 - color: MyColours.color_ffffff, 676 + color: classNameColor,
576 fontSize: ScreenUtil().setSp(28), 677 fontSize: ScreenUtil().setSp(28),
577 ), 678 ),
578 ), 679 ),
579 HEmptyView(20), 680 HEmptyView(20),
580 MyDivider(ScreenUtil().setWidth(80), 681 MyDivider(ScreenUtil().setWidth(80),
581 ScreenUtil().setWidth(2), 682 ScreenUtil().setWidth(2),
582 - color: MyColours.color_DBDBDB), 683 + color: classNameColor),
583 Container( 684 Container(
584 width: ScreenUtil().setWidth(10), 685 width: ScreenUtil().setWidth(10),
585 height: ScreenUtil().setWidth(10), 686 height: ScreenUtil().setWidth(10),
586 decoration: BoxDecoration( 687 decoration: BoxDecoration(
587 - color: MyColours.color_DBDBDB, 688 + color: classNameColor,
588 shape: BoxShape.circle), 689 shape: BoxShape.circle),
589 ), 690 ),
590 ], 691 ],
@@ -607,42 +708,59 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -607,42 +708,59 @@ class _MenuManagePageState extends State<MenuManagePage> {
607 if (model.imageType == '2') { 708 if (model.imageType == '2') {
608 //小图 709 //小图
609 return GestureDetector( 710 return GestureDetector(
  711 + onTap: () async {
  712 + await NavigatorUtil
  713 + .goMenuAddDishesPage(
  714 + context,
  715 + isNew: false,
  716 + idstr: model.id);
  717 + },
610 onLongPress: () async { 718 onLongPress: () async {
611 print('onLongPress 长按事件'); 719 print('onLongPress 长按事件');
612 720
613 _onLongPress(model, indexOut); 721 _onLongPress(model, indexOut);
614 }, 722 },
615 - child: Stack(  
616 - children: [  
617 - _smallMenu(model),  
618 - Positioned(  
619 - bottom: ScreenUtil()  
620 - .setWidth(14),  
621 - // right: ScreenUtil().setWidth(20),  
622 - child: model.status == '1'  
623 - ? SizedBox()  
624 - : Image.asset(  
625 - Utils.getImgPath(  
626 - 'stop-sell'),  
627 - width:  
628 - ScreenUtil() 723 + child: Padding(
  724 + padding: EdgeInsets.only(
  725 + bottom: w(2)),
  726 + child: Stack(
  727 + children: [
  728 + _smallMenu(model,
  729 + themeColerModel1),
  730 + Positioned(
  731 + bottom: ScreenUtil()
  732 + .setWidth(14),
  733 + // right: ScreenUtil().setWidth(20),
  734 + child: model.status ==
  735 + '1'
  736 + ? SizedBox()
  737 + : Image.asset(
  738 + Utils.getImgPath(
  739 + 'stop-sell'),
  740 + width: ScreenUtil()
629 .setWidth( 741 .setWidth(
630 182), 742 182),
631 - // height: ScreenUtil()  
632 - // .setWidth(52),  
633 - ))  
634 - ],  
635 - )); 743 + // height: ScreenUtil()
  744 + // .setWidth(52),
  745 + ))
  746 + ],
  747 + )));
636 } 748 }
637 749
638 return GestureDetector( 750 return GestureDetector(
  751 + onTap: () async {
  752 + await NavigatorUtil
  753 + .goMenuAddDishesPage(context,
  754 + isNew: false,
  755 + idstr: model.id);
  756 + },
639 onLongPress: () { 757 onLongPress: () {
640 print('onLongPress 长按事件'); 758 print('onLongPress 长按事件');
641 _onLongPress(model, indexOut); 759 _onLongPress(model, indexOut);
642 }, 760 },
643 child: Stack(children: [ 761 child: Stack(children: [
644 Container( 762 Container(
645 - color: MyColours.color_4D4E50, 763 + color: themeColerModel1.color,
646 margin: EdgeInsets.only( 764 margin: EdgeInsets.only(
647 bottom: (w(2))), 765 bottom: (w(2))),
648 child: Column( 766 child: Column(
@@ -704,8 +822,13 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -704,8 +822,13 @@ class _MenuManagePageState extends State<MenuManagePage> {
704 child: Text( 822 child: Text(
705 '江南传统名菜,口味咸鲜,汤白汁浓,肉质酥肥,笋清香脆嫩,鲜味浓厚。', 823 '江南传统名菜,口味咸鲜,汤白汁浓,肉质酥肥,笋清香脆嫩,鲜味浓厚。',
706 style: TextStyle( 824 style: TextStyle(
707 - color: MyColours  
708 - .color_DBDBDB, 825 + color: themeColerModel1
  826 + .name ==
  827 + '珍珠白'
  828 + ? MyColours
  829 + .color_515151
  830 + : MyColours
  831 + .color_FBF6F1,
709 fontSize: 832 fontSize:
710 font(12)), 833 font(12)),
711 ), 834 ),
@@ -722,7 +845,7 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -722,7 +845,7 @@ class _MenuManagePageState extends State<MenuManagePage> {
722 w(19)), 845 w(19)),
723 child: Image.asset( 846 child: Image.asset(
724 Utils.getImgPath( 847 Utils.getImgPath(
725 - 'add_area'), 848 + 'add_store'),
726 width: w(22), 849 width: w(22),
727 ), 850 ),
728 )) 851 ))
@@ -760,6 +883,14 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -760,6 +883,14 @@ class _MenuManagePageState extends State<MenuManagePage> {
760 Expanded( 883 Expanded(
761 flex: 1, 884 flex: 1,
762 child: GestureDetector( 885 child: GestureDetector(
  886 + onTap: () async {
  887 + await NavigatorUtil
  888 + .goMenuAddDishesPage(
  889 + context,
  890 + isNew: false,
  891 + idstr: temp[0]
  892 + .id);
  893 + },
763 onLongPress: () { 894 onLongPress: () {
764 print( 895 print(
765 'onLongPress 长按事件'); 896 'onLongPress 长按事件');
@@ -768,7 +899,8 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -768,7 +899,8 @@ class _MenuManagePageState extends State<MenuManagePage> {
768 }, 899 },
769 child: Stack( 900 child: Stack(
770 children: [ 901 children: [
771 - _smallMenu(temp[0]), 902 + _smallMenu(temp[0],
  903 + themeColerModel1),
772 Positioned( 904 Positioned(
773 bottom: 905 bottom:
774 ScreenUtil() 906 ScreenUtil()
@@ -794,6 +926,14 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -794,6 +926,14 @@ class _MenuManagePageState extends State<MenuManagePage> {
794 Expanded( 926 Expanded(
795 flex: 1, 927 flex: 1,
796 child: GestureDetector( 928 child: GestureDetector(
  929 + onTap: () async {
  930 + await NavigatorUtil
  931 + .goMenuAddDishesPage(
  932 + context,
  933 + isNew: false,
  934 + idstr: temp[1]
  935 + .id);
  936 + },
797 onLongPress: () { 937 onLongPress: () {
798 print( 938 print(
799 'onLongPress 长按事件'); 939 'onLongPress 长按事件');
@@ -803,7 +943,8 @@ class _MenuManagePageState extends State<MenuManagePage> { @@ -803,7 +943,8 @@ class _MenuManagePageState extends State<MenuManagePage> {
803 }, 943 },
804 child: Stack( 944 child: Stack(
805 children: [ 945 children: [
806 - _smallMenu(temp[1]), 946 + _smallMenu(temp[1],
  947 + themeColerModel1),
807 Positioned( 948 Positioned(
808 bottom: 949 bottom:
809 ScreenUtil() 950 ScreenUtil()
  1 +import 'dart:convert';
  2 +import 'dart:io';
  3 +
  4 +import 'package:cached_network_image/cached_network_image.dart';
  5 +import 'package:flutter/material.dart';
  6 +import 'package:flutter_native_image/flutter_native_image.dart';
  7 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  8 +import 'package:image_picker/image_picker.dart';
  9 +import 'package:one_key/provider/marketing_center_provider.dart';
  10 +import 'package:one_key/provider/menu_provider.dart';
  11 +import 'package:one_key/route/route_handles.dart';
  12 +import 'package:one_key/utils/dialog_util.dart';
  13 +import 'package:one_key/utils/utils.dart';
  14 +import 'package:one_key/widgets/system_app_bar.dart';
  15 +import 'package:one_key/widgets/v_empty_view.dart';
  16 +import 'package:permission_handler/permission_handler.dart';
  17 +import 'package:provider/provider.dart';
  18 +
  19 +import '../../../../app.dart';
  20 +import '../../../../models/theme_color_model.dart';
  21 +import '../../../../models/upload_img_model.dart';
  22 +import '../../../../provider/upload_img_provider.dart';
  23 +import '../../../../provider/user_model.dart';
  24 +import '../../../../res/colors.dart';
  25 +import '../../../../utils/screen_util.dart';
  26 +import '../../../../utils/upload_image_util.dart';
  27 +import '../../../../widgets/MyDivider.dart';
  28 +import '../../../../widgets/round_button.dart';
  29 +import '../../../constant/state.dart';
  30 +import '../../../models/cookbook_model.dart';
  31 +import '../../../widgets/h_empty_view.dart';
  32 +import '../../../widgets/page_exception.dart';
  33 +import '../../online_check/photo_view_wiget.dart';
  34 +
  35 +/**
  36 + * 菜单管理配置
  37 + */
  38 +
  39 +class MenuThemeColorSetPage extends StatefulWidget {
  40 + final List<MenuModel> menuModel;
  41 + MenuThemeColorSetPage({Key key, this.menuModel}) : super(key: key);
  42 +
  43 + @override
  44 + _MenuThemeColorSetPageState createState() => _MenuThemeColorSetPageState();
  45 +}
  46 +
  47 +class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> {
  48 + List<ThemeColorModel> themeColorData = [];
  49 + int themeColorIndex = 0;
  50 +
  51 + TextEditingController titleC = TextEditingController();
  52 + FocusNode titleNode = FocusNode();
  53 +
  54 + TextEditingController sloganC = TextEditingController();
  55 + FocusNode sloganNode = FocusNode();
  56 +
  57 + final picker = ImagePicker();
  58 +
  59 + ScrollController _controller = ScrollController();
  60 +
  61 + List<MenuModel> menuModelTemp = [];
  62 +
  63 + @override
  64 + void initState() {
  65 + super.initState();
  66 +
  67 + _initThemeColor();
  68 +
  69 + _handleData();
  70 + WidgetsBinding.instance.addPostFrameCallback((_) {
  71 + // getSellerTemplateConf();
  72 + // _getCookbookByClass(showLoading: true);
  73 + });
  74 + }
  75 +
  76 + @override
  77 + void dispose() {
  78 + super.dispose();
  79 + }
  80 +
  81 + // getSellerTemplateConf() async {
  82 + // bool success =
  83 + // await _marketingCenterProvider.getSellerTemplateConf(context);
  84 + // if (success && _marketingCenterProvider.markDataModel.home != null) {
  85 + // int colorValue =
  86 + // int.parse(_marketingCenterProvider.markDataModel.home.themeColor);
  87 + // if (colorValue == MyColours.color_0C0F0E.value) {
  88 + // themeColorIndex = 0;
  89 + // } else if (colorValue == MyColours.color_0143A3.value) {
  90 + // themeColorIndex = 1;
  91 + // } else if (colorValue == MyColours.color_438E93.value) {
  92 + // themeColorIndex = 2;
  93 + // }
  94 +
  95 + // titleC.text = _marketingCenterProvider.markDataModel.home.title;
  96 + // sloganC.text = _marketingCenterProvider.markDataModel.home.slogan;
  97 + // _uploadImageProvider.firstImage.qiniuUrl =
  98 + // _marketingCenterProvider.markDataModel.home.image ?? null;
  99 + // _uploadImageProvider.firstImage.process =
  100 + // _marketingCenterProvider.markDataModel.home.image != null &&
  101 + // _marketingCenterProvider.markDataModel.home.image != ''
  102 + // ? 1
  103 + // : null;
  104 + // setState(() {});
  105 + // }
  106 + // }
  107 +
  108 + ///初始化主题颜色
  109 + _initThemeColor() {
  110 + // int colorValue = App.sp.get("themeColor");
  111 +
  112 + // if (colorValue != null) {
  113 + // //缓存里有设置好的主题色
  114 + // if (colorValue == MyColours.color_0C0F0E.value) {
  115 + // themeColorIndex = 0;
  116 + // } else if (colorValue == MyColours.color_0143A3.value) {
  117 + // themeColorIndex = 1;
  118 + // } else if (colorValue == MyColours.color_438E93.value) {
  119 + // themeColorIndex = 2;
  120 + // }
  121 + // }
  122 + ThemeColorModel colorModel = ThemeColorModel();
  123 + colorModel.name = '睿智灰';
  124 + colorModel.color = MyColours.color_4D4E50;
  125 + themeColorData.add(colorModel);
  126 +
  127 + ThemeColorModel colorModel1 = ThemeColorModel();
  128 + colorModel1.name = '珍珠白';
  129 + colorModel1.color = MyColours.color_FBF6F1;
  130 + themeColorData.add(colorModel1);
  131 +
  132 + ThemeColorModel colorModel2 = ThemeColorModel();
  133 + colorModel2.name = '国风库金';
  134 + colorModel2.color = MyColours.color_877952;
  135 + themeColorData.add(colorModel2);
  136 +
  137 + ThemeColorModel colorModel3 = ThemeColorModel();
  138 + colorModel3.name = '群青绿';
  139 + colorModel3.color = MyColours.color_438E93;
  140 + themeColorData.add(colorModel3);
  141 +
  142 + ThemeColorModel colorModel4 = ThemeColorModel();
  143 + colorModel4.name = '国风绿';
  144 + colorModel4.color = MyColours.color_3E6F51;
  145 + themeColorData.add(colorModel4);
  146 + }
  147 +
  148 + Widget _item(String title, String subtitle, {GestureTapCallback onTap}) {
  149 + return InkWell(
  150 + onTap: onTap,
  151 + child: Container(
  152 + decoration: BoxDecoration(
  153 + border: Border(
  154 + bottom: BorderSide(
  155 + color: MyColours.color_E7E7E7, width: w(0.5)))),
  156 + margin: EdgeInsets.only(left: w(16)),
  157 + padding: EdgeInsets.only(top: w(12), bottom: w(12), right: w(12)),
  158 + child: Row(
  159 + children: [
  160 + Text(
  161 + title,
  162 + style: TextStyle(
  163 + color: MyColours.color_515151,
  164 + fontSize: ScreenUtil().setWidth(32)),
  165 + ),
  166 + Spacer(),
  167 + Text(
  168 + subtitle,
  169 + style: TextStyle(
  170 + color: MyColours.color_515151,
  171 + fontSize: ScreenUtil().setWidth(32)),
  172 + ),
  173 + Container(
  174 + padding:
  175 + EdgeInsets.symmetric(horizontal: w(7), vertical: w(4)),
  176 + child: Image.asset(
  177 + "assets/arrow_right_new.png",
  178 + width: ScreenUtil().setWidth(18),
  179 + height: ScreenUtil().setWidth(32),
  180 + ),
  181 + )
  182 + ],
  183 + )));
  184 + }
  185 +
  186 + //查看大图
  187 + _showPhotoView(BuildContext context, int index, List imgs,
  188 + {isShow = false, List dashName}) async {
  189 + // if (imgs.length == 1 &&
  190 + // imgs[0] ==
  191 + // 'http://nosqn.colorcun.com/custom/lite-online/image/def-banner.png') {
  192 + // imgs[0] = 'http://nosqn.colorcun.com/app/seller-hj-empty.png';
  193 + // }
  194 + Utils.setBarStatus(false, color: Colors.black);
  195 + dynamic result = await showGeneralDialog(
  196 + context: context,
  197 + barrierDismissible: false,
  198 + // barrierColor: Colors.red,
  199 + barrierLabel:
  200 + MaterialLocalizations.of(context).modalBarrierDismissLabel,
  201 + transitionDuration: const Duration(milliseconds: 150),
  202 + pageBuilder: (BuildContext context, Animation animation,
  203 + Animation secondaryAnimation) {
  204 + Widget child = Stack(
  205 + children: <Widget>[
  206 + PhotoPreview(
  207 + initialIndex: index,
  208 + photoList: imgs,
  209 + isShow: isShow,
  210 + dashName: dashName)
  211 + ],
  212 + );
  213 + return child;
  214 + });
  215 + Utils.setBarStatus(true, color: Colors.white);
  216 + }
  217 +
  218 + // _getCookbookByClass({bool showLoading = true}) async {
  219 + // Map<String, String> params = {
  220 + // "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
  221 + // };
  222 +
  223 + // await menuManageProvider.getCookbookByClass(context, params,
  224 + // showLoading: showLoading);
  225 + // _handleData();
  226 + // }
  227 +
  228 + ///处理数据
  229 + _handleData({isMove = false}) {
  230 + if (widget.menuModel != null) {
  231 + List<MenuModel> temp = [];
  232 + for (int i = 0; i < widget.menuModel.length; i++) {
  233 + List<dynamic> listSub = [];
  234 + // if (widget.menuModel[i].cookbooklist.length > 0 &&
  235 + // widget.menuModel[i].cookbooklist[0].indexNew == null &&
  236 + // !isMove) {
  237 + // //没有设置过顺序
  238 + // for (int j = 0;
  239 + // j < widget.menuModel[i].cookbooklist.length;
  240 + // j++) {
  241 + // widget.menuModel[i].cookbooklist[j].indexNew = j; //初始化菜单顺序
  242 + // }
  243 + // }
  244 + for (int j = 0; j < widget.menuModel[i].cookbooklist.length; j++) {
  245 + MenuSunModel menuSunModel = widget.menuModel[i].cookbooklist[j];
  246 + if (menuSunModel.imageType == '1') {
  247 + //大图
  248 + menuSunModel.indexNew = j;
  249 + listSub.add(menuSunModel);
  250 + } else {
  251 + //小图
  252 + //判断下一个是大图还是小图
  253 + if (widget.menuModel[i].cookbooklist.length - 1 > j) {
  254 + if (widget.menuModel[i].cookbooklist[j + 1].imageType == '1') {
  255 + //下一个是大图
  256 + menuSunModel.indexNew = j;
  257 + listSub.add(menuSunModel);
  258 + } else {
  259 + //下一个是小图
  260 +
  261 + List<MenuSunModel> subTemp = [];
  262 + menuSunModel.indexNew = j;
  263 + subTemp.add(menuSunModel);
  264 + widget.menuModel[i].cookbooklist[j + 1].indexNew = j + 1;
  265 + subTemp.add(widget.menuModel[i].cookbooklist[j + 1]);
  266 + listSub.add(subTemp);
  267 + j++;
  268 + }
  269 + } else {
  270 + menuSunModel.indexNew = j;
  271 + listSub.add(menuSunModel);
  272 + }
  273 + }
  274 + }
  275 + widget.menuModel[i].cookbooklistShow = listSub;
  276 + temp.add(widget.menuModel[i]);
  277 + }
  278 +
  279 + menuModelTemp = temp;
  280 + setState(() {});
  281 + }
  282 + }
  283 + //左边
  284 +
  285 + Widget _topLeft(MenuSunModel model) {
  286 + return Container(
  287 + child: Column(
  288 + crossAxisAlignment: CrossAxisAlignment.start,
  289 + children: [
  290 + Text(
  291 + model.name,
  292 + style: TextStyle(
  293 + fontWeight: FontWeight.bold,
  294 + fontSize: font(20),
  295 + color: MyColours.color_515151,
  296 + shadows: [
  297 + BoxShadow(
  298 + color: MyColours.color_FBF6F1,
  299 + offset: Offset(0, 1),
  300 + blurRadius: w(2),
  301 + spreadRadius: w(20))
  302 + ]),
  303 + ),
  304 + VEmptyView(20),
  305 + Text('味型:咸鲜 烹调:熬煮',
  306 + style: TextStyle(
  307 + fontWeight: FontWeight.bold,
  308 + fontSize: font(12),
  309 + color: MyColours.color_515151,
  310 + shadows: [
  311 + BoxShadow(
  312 + color: MyColours.color_FBF6F1,
  313 + offset: Offset(0, 1),
  314 + blurRadius: w(2),
  315 + spreadRadius: w(20))
  316 + ])),
  317 + VEmptyView(20),
  318 + Text(
  319 + '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ',
  320 + textAlign: TextAlign.right,
  321 + style: TextStyle(
  322 + fontWeight: FontWeight.bold,
  323 + fontSize: font(14),
  324 + color: MyColours.color_515151,
  325 + shadows: [
  326 + BoxShadow(
  327 + color: MyColours.color_FBF6F1,
  328 + offset: Offset(0, 1),
  329 + blurRadius: w(2),
  330 + spreadRadius: w(20))
  331 + ]),
  332 + ),
  333 + ],
  334 + ),
  335 + );
  336 + }
  337 +
  338 +
  339 + //右边
  340 + Widget _topRight(MenuSunModel model) {
  341 + return Container(
  342 + child: Column(
  343 + crossAxisAlignment: CrossAxisAlignment.end,
  344 + children: [
  345 + Text(
  346 + model.name,
  347 + style: TextStyle(
  348 + fontWeight: FontWeight.bold,
  349 + fontSize: font(20),
  350 + color: MyColours.color_515151,
  351 + shadows: [
  352 + BoxShadow(
  353 + color: MyColours.color_FBF6F1,
  354 + offset: Offset(0, 1),
  355 + blurRadius: w(2),
  356 + spreadRadius: w(20))
  357 + ]),
  358 + ),
  359 + VEmptyView(20),
  360 + Text('味型:咸鲜 烹调:熬煮',
  361 + style: TextStyle(
  362 + fontWeight: FontWeight.bold,
  363 + fontSize: font(12),
  364 + color: MyColours.color_515151,
  365 + shadows: [
  366 + BoxShadow(
  367 + color: MyColours.color_FBF6F1,
  368 + offset: Offset(0, 1),
  369 + blurRadius: w(2),
  370 + spreadRadius: w(20))
  371 + ])),
  372 + VEmptyView(20),
  373 + Text(
  374 + '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ',
  375 + textAlign: TextAlign.right,
  376 + style: TextStyle(
  377 + fontWeight: FontWeight.bold,
  378 + fontSize: font(14),
  379 + color: MyColours.color_515151,
  380 + shadows: [
  381 + BoxShadow(
  382 + color: MyColours.color_FBF6F1,
  383 + offset: Offset(0, 1),
  384 + blurRadius: w(2),
  385 + spreadRadius: w(20))
  386 + ]),
  387 + ),
  388 + ],
  389 + ),
  390 + );
  391 + }
  392 +
  393 +//顶部分开
  394 + Widget _topBetween(MenuSunModel model) {
  395 + return Row(
  396 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  397 + crossAxisAlignment: CrossAxisAlignment.start,
  398 + children: [
  399 + Container(
  400 + width: w(134),
  401 + child: Column(
  402 + crossAxisAlignment: CrossAxisAlignment.start,
  403 + children: [
  404 + Text(
  405 + model.name,
  406 + style: TextStyle(
  407 + fontWeight: FontWeight.bold,
  408 + fontSize: font(20),
  409 + color: MyColours.color_515151,
  410 + shadows: [
  411 + BoxShadow(
  412 + color: MyColours.color_FBF6F1,
  413 + offset: Offset(0, 1),
  414 + blurRadius: w(2),
  415 + spreadRadius: w(20))
  416 + ]),
  417 + ),
  418 + VEmptyView(20),
  419 + Text('味型:咸鲜 烹调:熬煮',
  420 + style: TextStyle(
  421 + fontWeight: FontWeight.bold,
  422 + fontSize: font(12),
  423 + color: MyColours.color_515151,
  424 + shadows: [
  425 + BoxShadow(
  426 + color: MyColours.color_FBF6F1,
  427 + offset: Offset(0, 1),
  428 + blurRadius: w(2),
  429 + spreadRadius: w(20))
  430 + ]))
  431 + ],
  432 + ),
  433 + ),
  434 + HEmptyView(10),
  435 + Text(
  436 + '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ',
  437 + textAlign: TextAlign.right,
  438 + style: TextStyle(
  439 + fontWeight: FontWeight.bold,
  440 + fontSize: font(14),
  441 + color: MyColours.color_515151,
  442 + shadows: [
  443 + BoxShadow(
  444 + color: MyColours.color_FBF6F1,
  445 + offset: Offset(0, 1),
  446 + blurRadius: w(2),
  447 + spreadRadius: w(20))
  448 + ]),
  449 + ),
  450 + ],
  451 + );
  452 + }
  453 +
  454 + Widget _smallMenu(MenuSunModel model, ThemeColorModel themeColerModel) {
  455 + return Container(
  456 + width: ScreenUtil().screenWidth / 2,
  457 + color: themeColerModel.color,
  458 + child: Column(
  459 + crossAxisAlignment: CrossAxisAlignment.start,
  460 + children: [
  461 + VEmptyView(30),
  462 + Padding(
  463 + padding: EdgeInsets.symmetric(horizontal: w(10)),
  464 + child: Text(
  465 + model.name,
  466 + style: TextStyle(
  467 + fontWeight: FontWeight.bold,
  468 + fontSize: font(20),
  469 + color: MyColours.color_515151,
  470 + shadows: [
  471 + BoxShadow(
  472 + color: MyColours.color_FBF6F1,
  473 + offset: Offset(0, 1),
  474 + blurRadius: w(2),
  475 + spreadRadius: w(20))
  476 + ]),
  477 + )),
  478 + VEmptyView(20),
  479 + Padding(
  480 + padding: EdgeInsets.symmetric(horizontal: w(10)),
  481 + child: Text(
  482 + '味型:咸鲜 烹调:熬煮',
  483 + style: TextStyle(
  484 + fontWeight: FontWeight.bold,
  485 + fontSize: font(12),
  486 + color: MyColours.color_515151,
  487 + shadows: [
  488 + BoxShadow(
  489 + color: MyColours.color_FBF6F1,
  490 + offset: Offset(0, 1),
  491 + blurRadius: w(2),
  492 + spreadRadius: w(20))
  493 + ]),
  494 + )),
  495 + VEmptyView(20),
  496 + Padding(
  497 + padding: EdgeInsets.symmetric(horizontal: w(10)),
  498 + child: Text(
  499 + '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ',
  500 + textAlign: TextAlign.right,
  501 + style: TextStyle(
  502 + fontWeight: FontWeight.bold,
  503 + fontSize: font(14),
  504 + color: MyColours.color_515151,
  505 + shadows: [
  506 + BoxShadow(
  507 + color: MyColours.color_FBF6F1,
  508 + offset: Offset(0, 1),
  509 + blurRadius: w(2),
  510 + spreadRadius: w(20))
  511 + ]),
  512 + )),
  513 + VEmptyView(30),
  514 + if (model.image != null)
  515 + CachedNetworkImage(
  516 + imageUrl: model.image,
  517 + fit: BoxFit.cover,
  518 + width: ScreenUtil().screenWidth / 2,
  519 + height: w(125),
  520 + ),
  521 + if (true)
  522 + Padding(
  523 + padding: EdgeInsets.symmetric(horizontal: w(10), vertical: w(10)),
  524 + child: Text(
  525 + '江南传统名菜,口味咸鲜,汤白汁浓,肉质酥肥,笋清香脆嫩,鲜味浓厚。',
  526 + style: TextStyle(
  527 + color: themeColerModel.name == '珍珠白'
  528 + ? MyColours.color_515151
  529 + : MyColours.color_FBF6F1,
  530 + fontSize: font(12)),
  531 + ),
  532 + ),
  533 + Align(
  534 + alignment: Alignment.centerRight,
  535 + child: Padding(
  536 + padding:
  537 + EdgeInsets.only(right: w(20), top: w(19), bottom: w(19)),
  538 + child: Image.asset(
  539 + Utils.getImgPath('add_store'),
  540 + width: w(22),
  541 + ),
  542 + )),
  543 + ],
  544 + ),
  545 + );
  546 + }
  547 +
  548 + @override
  549 + Widget build(BuildContext context) {
  550 + ThemeColorModel themeColerModel = themeColorData[themeColorIndex];
  551 +
  552 + // menuManageProvider = Provider.of<MenuManageProvider>(context, listen: true);
  553 +
  554 + return Scaffold(
  555 + backgroundColor: MyColours.color_ffffff,
  556 + appBar: SystemAppBar(
  557 + '菜单管理配置',
  558 + onTap: () {
  559 + Navigator.pop(context);
  560 + },
  561 + ),
  562 + body: Column(
  563 + children: [
  564 + Expanded(
  565 + child: SingleChildScrollView(
  566 + child: Column(
  567 + children: [
  568 + _item('客人所见菜单主题颜色选择', themeColerModel.name, onTap: () {
  569 + DialogUtil.showMenuThemeColorSelectDialog(
  570 + context, themeColorData, callback: (object) {
  571 + print(object);
  572 + setState(() {
  573 + themeColorIndex = object;
  574 + });
  575 + });
  576 + }),
  577 + VEmptyView(24),
  578 + Container(
  579 + height: w(48),
  580 + alignment: Alignment.centerLeft,
  581 + padding: EdgeInsets.symmetric(horizontal: w(16)),
  582 + child: Text(
  583 + '效果预览',
  584 + style: TextStyle(
  585 + color: MyColours.color_515151,
  586 + fontSize: ScreenUtil().setWidth(32)),
  587 + ),
  588 + ),
  589 + VEmptyView(24),
  590 + menuModelTemp == null || menuModelTemp.length == 0
  591 + ? Expanded(
  592 + child: Container(
  593 + color: MyColours.color_ffffff,
  594 + padding: EdgeInsets.symmetric(horizontal: w(20)),
  595 + child: Column(
  596 + crossAxisAlignment: CrossAxisAlignment.start,
  597 + children: [
  598 + VEmptyView(222),
  599 + Text(
  600 + '您还没有创建菜谱!',
  601 + style: TextStyle(
  602 + height: 1.3,
  603 + color: MyColours.color_515151,
  604 + fontSize: font(16),
  605 + fontWeight: FontWeight.bold),
  606 + ),
  607 + ],
  608 + ),
  609 + ))
  610 + :
  611 + // double cellWidth = (MediaQuery.of(context).size.width -
  612 + // ScreenUtil().setWidth(40 * 2 + 15 * 2) / 2);
  613 + // double desiredCellHeight = ScreenUtil().setWidth(700);
  614 + // double childAspectRatio = cellWidth / desiredCellHeight;
  615 + ListView.builder(
  616 + itemCount: menuModelTemp.length,
  617 + shrinkWrap: true,
  618 + controller: _controller,
  619 + itemBuilder: (BuildContext context, int indexOut) {
  620 + Color classNameColor = themeColerModel.name == '珍珠白'
  621 + ? MyColours.color_515151
  622 + : MyColours.color_FBF6F1;
  623 + return Column(
  624 + children: [
  625 + Container(
  626 + height: w(32),
  627 + color: themeColerModel.color,
  628 + margin: EdgeInsets.only(bottom: (w(2))),
  629 + child: Row(
  630 + mainAxisAlignment: MainAxisAlignment.center,
  631 + children: [
  632 + Container(
  633 + width: ScreenUtil().setWidth(10),
  634 + height: ScreenUtil().setWidth(10),
  635 + decoration: BoxDecoration(
  636 + color: classNameColor,
  637 + shape: BoxShape.circle),
  638 + ),
  639 + MyDivider(ScreenUtil().setWidth(80),
  640 + ScreenUtil().setWidth(2),
  641 + color: classNameColor),
  642 + HEmptyView(20),
  643 + Text(
  644 + menuModelTemp[indexOut].className,
  645 + style: TextStyle(
  646 + color: classNameColor,
  647 + fontSize: ScreenUtil().setSp(28),
  648 + ),
  649 + ),
  650 + HEmptyView(20),
  651 + MyDivider(ScreenUtil().setWidth(80),
  652 + ScreenUtil().setWidth(2),
  653 + color: classNameColor),
  654 + Container(
  655 + width: ScreenUtil().setWidth(10),
  656 + height: ScreenUtil().setWidth(10),
  657 + decoration: BoxDecoration(
  658 + color: classNameColor,
  659 + shape: BoxShape.circle),
  660 + ),
  661 + ],
  662 + )),
  663 + ListView.builder(
  664 + itemCount: menuModelTemp[indexOut]
  665 + .cookbooklistShow
  666 + .length,
  667 + shrinkWrap: true,
  668 + controller: _controller,
  669 + itemBuilder: (context, index) {
  670 + if (menuModelTemp[indexOut]
  671 + .cookbooklistShow[index]
  672 + is MenuSunModel) {
  673 + MenuSunModel model =
  674 + menuModelTemp[indexOut]
  675 + .cookbooklistShow[index];
  676 +
  677 + if (model.imageType == '2') {
  678 + //小图
  679 + return Padding(
  680 + padding:
  681 + EdgeInsets.only(bottom: w(2)),
  682 + child: Stack(
  683 + children: [
  684 + _smallMenu(
  685 + model, themeColerModel),
  686 + Positioned(
  687 + bottom: ScreenUtil()
  688 + .setWidth(14),
  689 + // right: ScreenUtil().setWidth(20),
  690 + child: model.status == '1'
  691 + ? SizedBox()
  692 + : Image.asset(
  693 + Utils.getImgPath(
  694 + 'stop-sell'),
  695 + width: ScreenUtil()
  696 + .setWidth(182),
  697 + // height: ScreenUtil()
  698 + // .setWidth(52),
  699 + ))
  700 + ],
  701 + ));
  702 + }
  703 +
  704 + return Stack(children: [
  705 + Container(
  706 + color: themeColerModel.color,
  707 + margin:
  708 + EdgeInsets.only(bottom: (w(2))),
  709 + child: Column(
  710 + crossAxisAlignment: model
  711 + .imageType !=
  712 + '2' &&
  713 + model.nameType == '1'
  714 + ? CrossAxisAlignment.start
  715 + : model.imageType != '2' &&
  716 + model.nameType == '2'
  717 + ? CrossAxisAlignment.end
  718 + : CrossAxisAlignment.center,
  719 + children: [
  720 + Container(
  721 + padding: EdgeInsets.only(
  722 + top: w(20),
  723 + left: w(20),
  724 + right: w(20),
  725 + bottom: w(15)),
  726 + child: model.imageType !=
  727 + '2' &&
  728 + model.nameType == '3'
  729 + ? _topBetween(model)
  730 + : model.imageType !=
  731 + '2' &&
  732 + model.nameType ==
  733 + '2'
  734 + ? _topRight(model)
  735 + : model.imageType !=
  736 + '2' &&
  737 + model.nameType ==
  738 + '1'
  739 + ? _topLeft(model)
  740 + : _topLeft(
  741 + model)),
  742 + if (model.image != null)
  743 + CachedNetworkImage(
  744 + imageUrl: model.image,
  745 + fit: BoxFit.cover,
  746 + width: double.infinity,
  747 + height: w(250),
  748 + ),
  749 + if (true)
  750 + Padding(
  751 + padding: EdgeInsets.symmetric(
  752 + horizontal: w(16),
  753 + vertical: w(10)),
  754 + child: Text(
  755 + '江南传统名菜,口味咸鲜,汤白汁浓,肉质酥肥,笋清香脆嫩,鲜味浓厚。',
  756 + style: TextStyle(
  757 + color: themeColerModel
  758 + .name ==
  759 + '珍珠白'
  760 + ? MyColours
  761 + .color_515151
  762 + : MyColours
  763 + .color_FBF6F1,
  764 + fontSize: font(12)),
  765 + ),
  766 + ),
  767 + Align(
  768 + alignment:
  769 + Alignment.centerRight,
  770 + child: Padding(
  771 + padding: EdgeInsets.only(
  772 + right: w(40),
  773 + top: w(19),
  774 + bottom: w(19)),
  775 + child: Image.asset(
  776 + Utils.getImgPath(
  777 + 'add_store'),
  778 + width: w(22),
  779 + ),
  780 + ))
  781 + ],
  782 + ),
  783 + ),
  784 + Positioned(
  785 + bottom: ScreenUtil().setWidth(14),
  786 + right: ScreenUtil().setWidth(20),
  787 + child: model.status == '1'
  788 + ? SizedBox()
  789 + : Image.asset(
  790 + Utils.getImgPath(
  791 + 'stop-sell'),
  792 + width: ScreenUtil()
  793 + .setWidth(182),
  794 + // height: ScreenUtil()
  795 + // .setWidth(52),
  796 + )),
  797 + ]);
  798 + } else if (menuModelTemp[indexOut]
  799 + .cookbooklistShow[index] is List) {
  800 + List<MenuSunModel> temp = widget
  801 + .menuModel[indexOut]
  802 + .cookbooklistShow[index];
  803 + return Padding(
  804 + padding:
  805 + EdgeInsets.only(bottom: w(2)),
  806 + child: Row(
  807 + children: [
  808 + Expanded(
  809 + flex: 1,
  810 + child: Stack(
  811 + children: [
  812 + _smallMenu(temp[0],
  813 + themeColerModel),
  814 + Positioned(
  815 + bottom: ScreenUtil()
  816 + .setWidth(14),
  817 + // right: ScreenUtil().setWidth(20),
  818 + child:
  819 + temp[0].status ==
  820 + '1'
  821 + ? SizedBox()
  822 + : Image.asset(
  823 + Utils.getImgPath(
  824 + 'stop-sell'),
  825 + width: ScreenUtil()
  826 + .setWidth(
  827 + 182),
  828 + // height: ScreenUtil()
  829 + // .setWidth(52),
  830 + ))
  831 + ],
  832 + )),
  833 + HEmptyView(4),
  834 + Expanded(
  835 + flex: 1,
  836 + child: Stack(
  837 + children: [
  838 + _smallMenu(temp[1],
  839 + themeColerModel),
  840 + Positioned(
  841 + bottom: ScreenUtil()
  842 + .setWidth(14),
  843 + // right: ScreenUtil().setWidth(20),
  844 + child:
  845 + temp[1].status ==
  846 + '1'
  847 + ? SizedBox()
  848 + : Image.asset(
  849 + Utils.getImgPath(
  850 + 'stop-sell'),
  851 + width: ScreenUtil()
  852 + .setWidth(
  853 + 182),
  854 + // height: ScreenUtil()
  855 + // .setWidth(52),
  856 + ))
  857 + ],
  858 + ))
  859 + ],
  860 + ));
  861 + }
  862 + })
  863 + ],
  864 + );
  865 + })
  866 + ],
  867 + ),
  868 + )),
  869 + Container(
  870 + color: MyColours.color_ffffff,
  871 + padding: EdgeInsets.only(
  872 + left: w(45), right: w(45), top: w(12), bottom: w(25)),
  873 + child: RoundButton(
  874 + text: '保存',
  875 + gradientStart: MyColours.color_199095,
  876 + gradientEnd: MyColours.color_199095,
  877 + // borderColor: MyColours.color_999999,
  878 + radius: r(5),
  879 + fontSize: 34,
  880 + height: w(40),
  881 + isBold: true,
  882 + onPressed: () async {
  883 + // App.sp.setInt(
  884 + // "themeColor", themeColorData[themeColorIndex].color.value);
  885 + //接口
  886 + Map homeData = {
  887 + 'theme_color':
  888 + themeColorData[themeColorIndex].color.value.toString(),
  889 + 'red': themeColorData[themeColorIndex].color.red,
  890 + 'green': themeColorData[themeColorIndex].color.green,
  891 + 'blue': themeColorData[themeColorIndex].color.blue,
  892 + 'alpha': themeColorData[themeColorIndex].color.opacity,
  893 + };
  894 + Map<String, String> params = {
  895 + 'sid': Provider.of<UserModel>(context, listen: false)
  896 + .user
  897 + .sellerid,
  898 + 'home': json.encode(homeData)
  899 + };
  900 +
  901 + // bool success = await menuManageProvider
  902 + // .setSellerTemplateConf(context, params, showLoading: true);
  903 + // if (success) {
  904 + // Utils.showToast('保存成功');
  905 + // Navigator.pop(context);
  906 + // }
  907 + },
  908 + ),
  909 + )
  910 + ],
  911 + ),
  912 + );
  913 + }
  914 +}
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 2
3 class MyColours { 3 class MyColours {
  4 + static const Color color_3E6F51 = Color(0xFF3E6F51);
  5 + static const Color color_877952 = Color(0xFF877952);
  6 + static const Color color_FBF6F1 = Color(0xFFFBF6F1);
4 static const Color color_4D4E50 = Color(0xFF4D4E50); 7 static const Color color_4D4E50 = Color(0xFF4D4E50);
5 static const Color color_00715F = Color(0xFF00715F); 8 static const Color color_00715F = Color(0xFF00715F);
6 static const Color color_80D9D9D9 = Color(0x80D9D9D9); 9 static const Color color_80D9D9D9 = Color(0x80D9D9D9);
@@ -1669,4 +1669,15 @@ class NavigatorUtil { @@ -1669,4 +1669,15 @@ class NavigatorUtil {
1669 return _navigateTo(context, "${Routes.menu_dish_method_page}", 1669 return _navigateTo(context, "${Routes.menu_dish_method_page}",
1670 replace: replace); 1670 replace: replace);
1671 } 1671 }
  1672 +
  1673 + ///菜单管理-----菜单管理配置
  1674 + static Future<dynamic> goMenuThemeColorSetPage(
  1675 + BuildContext context,
  1676 + Map object, {
  1677 + replace = false,
  1678 + }) {
  1679 + return _navigateTo(context,
  1680 + "${Routes.menu_theme_color_set_page}?object=${FluroConvertUtils.object2string(object)}",
  1681 + replace: replace);
  1682 + }
1672 } 1683 }
@@ -200,6 +200,7 @@ import '../pages/my/marketing_center/recharge/recharge_select_store_coupon_page. @@ -200,6 +200,7 @@ import '../pages/my/marketing_center/recharge/recharge_select_store_coupon_page.
200 import '../pages/my/menu_type/menu_add_dishes_page.dart'; 200 import '../pages/my/menu_type/menu_add_dishes_page.dart';
201 import '../pages/my/menu_type/menu_dish_method_page.dart'; 201 import '../pages/my/menu_type/menu_dish_method_page.dart';
202 import '../pages/my/menu_type/menu_manage_page.dart'; 202 import '../pages/my/menu_type/menu_manage_page.dart';
  203 +import '../pages/my/menu_type/menu_theme_color_set_page.dart';
203 import '../pages/my/menu_type/menu_unit_page.dart'; 204 import '../pages/my/menu_type/menu_unit_page.dart';
204 import '../pages/my/plan_dish/final_plan_dish_page.dart'; 205 import '../pages/my/plan_dish/final_plan_dish_page.dart';
205 import '../pages/my/plan_dish/my_plan_dish_home_page.dart'; 206 import '../pages/my/plan_dish/my_plan_dish_home_page.dart';
@@ -2672,8 +2673,6 @@ var menuSetPricePageHandle = new Handler( @@ -2672,8 +2673,6 @@ var menuSetPricePageHandle = new Handler(
2672 create: (_) => MenuManageProvider(), child: MenuSetPricePage()); 2673 create: (_) => MenuManageProvider(), child: MenuSetPricePage());
2673 }); 2674 });
2674 2675
2675 -  
2676 -  
2677 ///菜单管理--配置销售单位 2676 ///菜单管理--配置销售单位
2678 var menuUnitPageHandle = new Handler( 2677 var menuUnitPageHandle = new Handler(
2679 handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { 2678 handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
@@ -2684,7 +2683,6 @@ var menuUnitPageHandle = new Handler( @@ -2684,7 +2683,6 @@ var menuUnitPageHandle = new Handler(
2684 create: (_) => MenuManageProvider(), child: MenuUnitPage()); 2683 create: (_) => MenuManageProvider(), child: MenuUnitPage());
2685 }); 2684 });
2686 2685
2687 -  
2688 ///菜单管理--做法 2686 ///菜单管理--做法
2689 var menuDishMethodPageHandle = new Handler( 2687 var menuDishMethodPageHandle = new Handler(
2690 handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { 2688 handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
@@ -2694,3 +2692,19 @@ var menuDishMethodPageHandle = new Handler( @@ -2694,3 +2692,19 @@ var menuDishMethodPageHandle = new Handler(
2694 return ChangeNotifierProvider<MenuManageProvider>( 2692 return ChangeNotifierProvider<MenuManageProvider>(
2695 create: (_) => MenuManageProvider(), child: MenuDishMethodPage()); 2693 create: (_) => MenuManageProvider(), child: MenuDishMethodPage());
2696 }); 2694 });
  2695 +
  2696 +///菜单管理--菜单管理配置
  2697 +var menuThemeColorSetPageHandle = new Handler(
  2698 + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
  2699 + List<MenuModel> res = [];
  2700 + if (params.keys.contains('object')) {
  2701 + Map object = FluroConvertUtils.string2map(params["object"].first);
  2702 + List temp = object['object'];
  2703 +
  2704 + for (var item in temp) {
  2705 + res.add(MenuModel.fromJson2(item));
  2706 + }
  2707 + }
  2708 + return ChangeNotifierProvider<MenuManageProvider>(
  2709 + create: (_) => MenuManageProvider(), child: MenuThemeColorSetPage(menuModel:res));
  2710 +});
@@ -244,9 +244,10 @@ class Routes { @@ -244,9 +244,10 @@ class Routes {
244 244
245 static String menu_unit_page = "/menu_unit_page"; //菜单管理---配置销售单位 245 static String menu_unit_page = "/menu_unit_page"; //菜单管理---配置销售单位
246 246
247 - static String menu_dish_method_page = "/menu_dish_method_page"; //菜单管理---做法 247 + static String menu_dish_method_page = "/menu_dish_method_page"; //菜单管理---做法
248 248
249 - 249 + static String menu_theme_color_set_page =
  250 + "/menu_theme_color_set_page"; //菜单管理---菜单管理配置
250 251
251 static void configureRoutes(FluroRouter router) { 252 static void configureRoutes(FluroRouter router) {
252 router.notFoundHandler = new Handler( 253 router.notFoundHandler = new Handler(
@@ -470,8 +471,8 @@ class Routes { @@ -470,8 +471,8 @@ class Routes {
470 router.define(order_share_page, handler: orderSharePageHandle); 471 router.define(order_share_page, handler: orderSharePageHandle);
471 router.define(menu_set_price_page, handler: menuSetPricePageHandle); 472 router.define(menu_set_price_page, handler: menuSetPricePageHandle);
472 router.define(menu_unit_page, handler: menuUnitPageHandle); 473 router.define(menu_unit_page, handler: menuUnitPageHandle);
473 - router.define(menu_dish_method_page,handler: menuDishMethodPageHandle);  
474 - 474 + router.define(menu_dish_method_page, handler: menuDishMethodPageHandle);
  475 + router.define(menu_theme_color_set_page, handler: menuThemeColorSetPageHandle);
475 476
476 } 477 }
477 } 478 }
@@ -5166,6 +5166,129 @@ class DialogUtil { @@ -5166,6 +5166,129 @@ class DialogUtil {
5166 }); 5166 });
5167 } 5167 }
5168 5168
  5169 + //菜单主题颜色选择弹框
  5170 + static showMenuThemeColorSelectDialog(
  5171 + BuildContext context, List<ThemeColorModel> themeColorData,
  5172 + {CustomCallBack callback}) {
  5173 + return showModalBottomSheet(
  5174 + context: context,
  5175 + isScrollControlled: true,
  5176 + shape: RoundedRectangleBorder(
  5177 + borderRadius: BorderRadius.only(
  5178 + topLeft: Radius.circular(30), topRight: Radius.circular(30)),
  5179 + ),
  5180 + builder: (context) {
  5181 + Widget widget = Container(
  5182 + width: double.infinity,
  5183 + // height: w(536),
  5184 + color: MyColours.color_ffffff,
  5185 + child: Stack(children: [
  5186 + SingleChildScrollView(
  5187 + child: Column(
  5188 + mainAxisSize: MainAxisSize.min,
  5189 + children: <Widget>[
  5190 + VEmptyView(174),
  5191 + ListView.builder(
  5192 + shrinkWrap: true,
  5193 + itemCount: themeColorData.length,
  5194 + itemBuilder: (context, index) {
  5195 + return InkWell(
  5196 + onTap: () {
  5197 + Navigator.pop(context);
  5198 + callback(index);
  5199 + },
  5200 + child: Container(
  5201 + decoration: themeColorData[index].name != '珍珠白'
  5202 + ? BoxDecoration(
  5203 + color: themeColorData[index].color,
  5204 + )
  5205 + : BoxDecoration(
  5206 + color: themeColorData[index].color,
  5207 + border: Border.all(
  5208 + width: w(1),
  5209 + color: MyColours.color_515151)),
  5210 + width: double.infinity,
  5211 + height: w(90),
  5212 + margin: EdgeInsets.only(
  5213 + left: w(30), right: w(30), bottom: w(8)),
  5214 + padding:
  5215 + EdgeInsets.only(left: w(10), top: w(13)),
  5216 + child: Container(
  5217 + width: w(61),
  5218 + height: w(27),
  5219 + child: Text(themeColorData[index].name,
  5220 + style: TextStyle(
  5221 + color: themeColorData[index].name ==
  5222 + '珍珠白'
  5223 + ? MyColours.color_515151
  5224 + : MyColours.color_ffffff,
  5225 + fontWeight: FontWeight.bold,
  5226 + fontSize: font(16))))));
  5227 + }),
  5228 + // InkWell(
  5229 + // onTap: () {
  5230 + // Navigator.pop(context);
  5231 + // callback(0);
  5232 + // },
  5233 + // child: Container(
  5234 + // width: double.infinity,
  5235 + // height: w(106),
  5236 + // color: themeColorData[0].color,
  5237 + // margin: EdgeInsets.symmetric(horizontal: w(30)),
  5238 + // padding: EdgeInsets.only(left: w(10), top: w(13)),
  5239 + // child: Container(
  5240 + // width: w(61),
  5241 + // height: w(27),
  5242 + // child: Text(themeColorData[0].name,
  5243 + // style: TextStyle(
  5244 + // color: MyColours.color_ffffff,
  5245 + // fontWeight: FontWeight.bold,
  5246 + // fontSize: font(16)))))),
  5247 + // VEmptyView(56),
  5248 + // VEmptyView(56),
  5249 + // InkWell(
  5250 + // onTap: () {
  5251 + // Navigator.pop(context);
  5252 + // callback(2);
  5253 + // },
  5254 + // child: Container(
  5255 + // color: themeColorData[2].color,
  5256 + // width: double.infinity,
  5257 + // height: w(106),
  5258 + // margin: EdgeInsets.symmetric(horizontal: w(30)),
  5259 + // padding: EdgeInsets.only(left: w(10), top: w(13)),
  5260 + // child: Container(
  5261 + // width: w(61),
  5262 + // height: w(27),
  5263 + // child: Text(themeColorData[2].name,
  5264 + // style: TextStyle(
  5265 + // color: MyColours.color_ffffff,
  5266 + // fontWeight: FontWeight.bold,
  5267 + // fontSize: font(16)))))),
  5268 + VEmptyView(66),
  5269 + ],
  5270 + )),
  5271 + Positioned(
  5272 + right: w(10),
  5273 + top: w(25),
  5274 + child: InkWell(
  5275 + onTap: () {
  5276 + Navigator.pop(context);
  5277 + },
  5278 + child: Padding(
  5279 + padding: EdgeInsets.symmetric(horizontal: w(18)),
  5280 + child: Text("取消",
  5281 + style: TextStyle(
  5282 + fontWeight: FontWeight.bold,
  5283 + fontSize: ScreenUtil().setSp(32),
  5284 + color: MyColours.color_000000)),
  5285 + ))),
  5286 + ]),
  5287 + );
  5288 + return widget;
  5289 + });
  5290 + }
  5291 +
5169 //主题颜色选择弹框 5292 //主题颜色选择弹框
5170 static showThemeColorSelectDialog( 5293 static showThemeColorSelectDialog(
5171 BuildContext context, List<ThemeColorModel> themeColorData, 5294 BuildContext context, List<ThemeColorModel> themeColorData,