|
...
|
...
|
@@ -36,6 +36,7 @@ import 'package:table_calendar/table_calendar.dart'; |
|
|
|
import 'package:one_key/models/table.dart' as t;
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
|
|
import '../models/radio_model.dart';
|
|
|
|
import '../models/theme_color_model.dart';
|
|
|
|
|
|
|
|
typedef CustomCallBack = void Function(Object object);
|
|
...
|
...
|
@@ -53,14 +54,19 @@ typedef ClickCallback = void Function(String value); |
|
|
|
// };
|
|
|
|
|
|
|
|
class DialogUtil {
|
|
|
|
static Future menuMagageAlertDialog(BuildContext context,
|
|
|
|
{GestureTapCallback onTap, double fontSize = 32}) async {
|
|
|
|
static Future menuMagageAlertDialog(
|
|
|
|
BuildContext context,
|
|
|
|
List<RadioModel> nameTypeList,
|
|
|
|
List<RadioModel> imageTypeList,
|
|
|
|
List<RadioModel> moveList,
|
|
|
|
{GestureTapCallback onTap,
|
|
|
|
double fontSize = 32}) async {
|
|
|
|
final action = await showDialog(
|
|
|
|
context: context,
|
|
|
|
barrierDismissible: true,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
return Center(
|
|
|
|
child: Container(
|
|
|
|
return Center(child: StatefulBuilder(builder: (context, state) {
|
|
|
|
return Container(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(20)),
|
|
|
|
decoration: BoxDecoration(
|
|
...
|
...
|
@@ -71,68 +77,138 @@ class DialogUtil { |
|
|
|
Radius.circular(ScreenUtil().setWidth(30)))), //设置圆角
|
|
|
|
child: Column(mainAxisSize: MainAxisSize.min, children: [
|
|
|
|
VEmptyView(92),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(96),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text('菜品名称(味型/烹调)及价格在顶部左侧',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(fontSize),
|
|
|
|
color: MyColours.color_515151)),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(96),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text('菜品名称(味型/烹调)及价格在顶部右侧',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(fontSize),
|
|
|
|
color: MyColours.color_515151)),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(96),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text('菜品名称(味型/烹调)及价格在顶部分开',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(fontSize),
|
|
|
|
color: MyColours.color_515151)),
|
|
|
|
),
|
|
|
|
ListView.builder(
|
|
|
|
itemCount: nameTypeList.length,
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
if (imageTypeList.length > 1 &&
|
|
|
|
imageTypeList[1].select) {
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
nameTypeList.forEach((element) {
|
|
|
|
element.select = false;
|
|
|
|
});
|
|
|
|
nameTypeList[index].select = true;
|
|
|
|
state(() {});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil().setWidth(96),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text(nameTypeList[index].title,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(fontSize),
|
|
|
|
color: imageTypeList.length > 1 &&
|
|
|
|
imageTypeList[1].select
|
|
|
|
? MyColours.color_999999
|
|
|
|
: nameTypeList[index].select
|
|
|
|
? MyColours.color_438E93
|
|
|
|
: MyColours.color_515151)),
|
|
|
|
));
|
|
|
|
}),
|
|
|
|
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(96),
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
// child: Text('菜品名称(味型/烹调)及价格在顶部右侧',
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setSp(fontSize),
|
|
|
|
// color: MyColours.color_515151)),
|
|
|
|
// ),
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(96),
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
// child: Text('菜品名称(味型/烹调)及价格在顶部分开',
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setSp(fontSize),
|
|
|
|
// color: MyColours.color_515151)),
|
|
|
|
// ),
|
|
|
|
MyDivider(
|
|
|
|
ScreenUtil().setWidth(280 * 2), ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_efefef),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(96),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text('大图展示菜品',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(fontSize),
|
|
|
|
color: MyColours.color_515151)),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(96),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text('小图展示菜品',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(fontSize),
|
|
|
|
color: MyColours.color_515151)),
|
|
|
|
),
|
|
|
|
ListView.builder(
|
|
|
|
itemCount: imageTypeList.length,
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
imageTypeList.forEach((element) {
|
|
|
|
element.select = false;
|
|
|
|
});
|
|
|
|
imageTypeList[index].select = true;
|
|
|
|
state(() {});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil().setWidth(96),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text(imageTypeList[index].title,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(fontSize),
|
|
|
|
color: imageTypeList[index].select
|
|
|
|
? MyColours.color_438E93
|
|
|
|
: MyColours.color_515151)),
|
|
|
|
));
|
|
|
|
}),
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(96),
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
// child: Text('大图展示菜品',
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setSp(fontSize),
|
|
|
|
// color: MyColours.color_515151)),
|
|
|
|
// ),
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(96),
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
// child: Text('小图展示菜品',
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setSp(fontSize),
|
|
|
|
// color: MyColours.color_515151)),
|
|
|
|
// ),
|
|
|
|
MyDivider(
|
|
|
|
ScreenUtil().setWidth(280 * 2), ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_efefef),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(96),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text('菜品向上移动一个',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(fontSize),
|
|
|
|
color: MyColours.color_515151)),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(96),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text('菜品向下移动一个',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(fontSize),
|
|
|
|
color: MyColours.color_515151)),
|
|
|
|
),
|
|
|
|
ListView.builder(
|
|
|
|
itemCount: moveList.length,
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
moveList.forEach((element) {
|
|
|
|
element.select = false;
|
|
|
|
});
|
|
|
|
moveList[index].select = true;
|
|
|
|
state(() {});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil().setWidth(96),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text(moveList[index].title,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(fontSize),
|
|
|
|
color: moveList[index].select
|
|
|
|
? MyColours.color_438E93
|
|
|
|
: MyColours.color_515151)),
|
|
|
|
));
|
|
|
|
}),
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(96),
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
// child: Text('菜品向上移动一个',
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setSp(fontSize),
|
|
|
|
// color: MyColours.color_515151)),
|
|
|
|
// ),
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(96),
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
// child: Text('菜品向下移动一个',
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setSp(fontSize),
|
|
|
|
// color: MyColours.color_515151)),
|
|
|
|
// ),
|
|
|
|
VEmptyView(60),
|
|
|
|
MyDivider(double.infinity, ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_f3f3f3),
|
|
...
|
...
|
@@ -175,18 +251,37 @@ class DialogUtil { |
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// onTap(controller.text);
|
|
|
|
|
|
|
|
List<RadioModel> nameSelect = nameTypeList
|
|
|
|
.where((element) => element.select)
|
|
|
|
.toList();
|
|
|
|
List<RadioModel> imageSelect = imageTypeList
|
|
|
|
.where((element) => element.select)
|
|
|
|
.toList();
|
|
|
|
List<RadioModel> moveSelect = moveList
|
|
|
|
.where((element) => element.select)
|
|
|
|
.toList();
|
|
|
|
Navigator.pop(context, {
|
|
|
|
'name_type': '1',
|
|
|
|
'image_type': '1',
|
|
|
|
'move': '1'
|
|
|
|
'name_type':
|
|
|
|
nameSelect != null && nameSelect.length > 0
|
|
|
|
? nameSelect[0].code
|
|
|
|
: null,
|
|
|
|
'image_type':
|
|
|
|
imageSelect != null && imageSelect.length > 0
|
|
|
|
? imageSelect[0].code
|
|
|
|
: null,
|
|
|
|
'move':
|
|
|
|
moveSelect != null && moveSelect.length > 0
|
|
|
|
? moveSelect[0].code
|
|
|
|
: null,
|
|
|
|
});
|
|
|
|
// }
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
])),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}));
|
|
|
|
},
|
|
|
|
);
|
|
|
|
return action;
|
...
|
...
|
|