|
...
|
...
|
@@ -40,6 +40,7 @@ import 'package:one_key/models/table.dart' as t; |
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
|
|
import '../app.dart';
|
|
|
|
import '../models/all_cuisine.dart';
|
|
|
|
import '../models/cookbook_model.dart';
|
|
|
|
import '../models/customer_label_model.dart';
|
|
|
|
import '../models/get_reserve_type_field_model.dart';
|
|
...
|
...
|
@@ -224,6 +225,84 @@ class DialogUtil { |
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
|
|
|
static List<Widget> cuisineSelecctBtn(List<AllCuisineSunModel> menuSunModel,
|
|
|
|
state, List<String> selectType, ClickkListCallbac callback) {
|
|
|
|
List<Widget> temp = [];
|
|
|
|
for (int i = 0; i < menuSunModel.length; i++) {
|
|
|
|
AllCuisineSunModel practiceModel = menuSunModel[i];
|
|
|
|
temp.add(InkWell(
|
|
|
|
onTap: () {
|
|
|
|
// for (int j = 0; j < menuSunModel.length; j++) {
|
|
|
|
// menuSunModel[j].select = false;
|
|
|
|
// }
|
|
|
|
practiceModel.select = !practiceModel.select;
|
|
|
|
if (practiceModel.select) {
|
|
|
|
selectType.add(practiceModel.id);
|
|
|
|
} else {
|
|
|
|
selectType.remove(practiceModel.id);
|
|
|
|
}
|
|
|
|
|
|
|
|
callback(selectType);
|
|
|
|
state(() {});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
// height: w(34),
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(horizontal: w(10), vertical: w(5)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(
|
|
|
|
color: practiceModel.select
|
|
|
|
? MyColours.color_438E93
|
|
|
|
: MyColours.color_515151,
|
|
|
|
width: w(1)),
|
|
|
|
borderRadius: BorderRadius.circular(r(5)),
|
|
|
|
color: practiceModel.select
|
|
|
|
? MyColours.color_438E93
|
|
|
|
: MyColours.color_ffffff,
|
|
|
|
),
|
|
|
|
child: Text(practiceModel.name,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(14),
|
|
|
|
color: practiceModel.select
|
|
|
|
? MyColours.color_ffffff
|
|
|
|
: MyColours.color_515151,
|
|
|
|
)),
|
|
|
|
))
|
|
|
|
|
|
|
|
// RoundButton(
|
|
|
|
// text: practiceModel.name,
|
|
|
|
// // bgColor: MyColours.color_ffffff,
|
|
|
|
// gradientStart: practiceModel.select
|
|
|
|
// ? MyColours.color_438E93
|
|
|
|
// : MyColours.color_ffffff,
|
|
|
|
// gradientEnd: practiceModel.select
|
|
|
|
// ? MyColours.color_438E93
|
|
|
|
// : MyColours.color_ffffff,
|
|
|
|
// // width: w(80),
|
|
|
|
// padding: EdgeInsets.symmetric(horizontal: w(10), vertical: w(5)),
|
|
|
|
// height: w(34),
|
|
|
|
// isBold: false,
|
|
|
|
// radius: r(5),
|
|
|
|
// textColor: practiceModel.select
|
|
|
|
// ? MyColours.color_ffffff
|
|
|
|
// : MyColours.color_515151,
|
|
|
|
// borderColor: practiceModel.select
|
|
|
|
// ? MyColours.color_438E93
|
|
|
|
// : MyColours.color_515151,
|
|
|
|
// onPressed: () {
|
|
|
|
// for (int j = 0; j < menuSunModel.length; j++) {
|
|
|
|
// menuSunModel[j].select = false;
|
|
|
|
// }
|
|
|
|
// menuSunModel[i].select = true;
|
|
|
|
// callback(menuSunModel[i].name);
|
|
|
|
// state(() {});
|
|
|
|
// },
|
|
|
|
// )
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
|
|
|
static List<Widget> dishSelectBtn(
|
|
|
|
List<GetReserveTypeFieldsSunModel> menuSunModel,
|
|
|
|
state,
|
|
...
|
...
|
@@ -631,6 +710,107 @@ class DialogUtil { |
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
///菜系选择
|
|
|
|
static openCuisineSelectModalBottomSheet(context,
|
|
|
|
List<AllCuisineSunModel> cuisineAllDatas, List<String> cuisineIds,
|
|
|
|
{VoidCallback lCallback, ClickkListCallbac rCallback}) async {
|
|
|
|
List<String> selectType = List.from(cuisineIds);
|
|
|
|
|
|
|
|
if (cuisineIds.length > 0) {
|
|
|
|
cuisineAllDatas.forEach((element) {
|
|
|
|
element.select = false;
|
|
|
|
if (cuisineIds.contains(element.id)) {
|
|
|
|
element.select = true;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
final option = await showModalBottomSheet(
|
|
|
|
context: context,
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
isDismissible: false,
|
|
|
|
isScrollControlled: true,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
return StatefulBuilder(builder: (context, state) {
|
|
|
|
return Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
topLeft: Radius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
topRight: Radius.circular(ScreenUtil().setWidth(10)))),
|
|
|
|
child:
|
|
|
|
Column(mainAxisSize: MainAxisSize.min, children: <Widget>[
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
GestureDetector(
|
|
|
|
behavior: HitTestBehavior.opaque,
|
|
|
|
onTap: () {
|
|
|
|
cuisineAllDatas.forEach((element) {
|
|
|
|
element.select = false;
|
|
|
|
});
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
// width: double.infinity,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: w(15),
|
|
|
|
vertical: ScreenUtil().setWidth(40)),
|
|
|
|
child: Text(
|
|
|
|
"取消",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_438E93),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
// width: double.infinity,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: ScreenUtil().setWidth(40)),
|
|
|
|
child: Text(
|
|
|
|
"选择经营菜系",
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_E6000000),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GestureDetector(
|
|
|
|
behavior: HitTestBehavior.opaque,
|
|
|
|
onTap: () {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
rCallback(selectType);
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
// width: double.infinity,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: w(15),
|
|
|
|
vertical: ScreenUtil().setWidth(40)),
|
|
|
|
child: Text("确定",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_438E93)),
|
|
|
|
)),
|
|
|
|
]),
|
|
|
|
VEmptyView(50),
|
|
|
|
Wrap(
|
|
|
|
spacing: w(12),
|
|
|
|
runSpacing: w(12),
|
|
|
|
children: cuisineSelecctBtn(
|
|
|
|
cuisineAllDatas, state, selectType, (value) {
|
|
|
|
selectType = value;
|
|
|
|
})),
|
|
|
|
VEmptyView(50),
|
|
|
|
]));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
cuisineAllDatas.forEach((element) {
|
|
|
|
element.select = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
///用餐类型
|
|
|
|
static openDishTypeSelectModalBottomSheet(context,
|
|
|
|
List<GetReserveTypeFieldsSunModel> reserveTypes, String reserveType,
|
|
...
|
...
|
@@ -9009,7 +9189,7 @@ class DialogUtil { |
|
|
|
// yearBegin: DateTime.now().year,
|
|
|
|
// yearEnd: 2030,
|
|
|
|
minValue: DateTime(1925),
|
|
|
|
maxValue:DateTime.now(),
|
|
|
|
maxValue: DateTime.now(),
|
|
|
|
value: dateTime),
|
|
|
|
height: ScreenUtil().setWidth(480),
|
|
|
|
hideHeader: false,
|
...
|
...
|
|