|
...
|
...
|
@@ -38,6 +38,7 @@ import 'package:one_key/models/table.dart' as t; |
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
|
|
import '../models/cookbook_model.dart';
|
|
|
|
import '../models/get_reserve_type_field_model.dart';
|
|
|
|
import '../models/radio_model.dart';
|
|
|
|
import '../models/seller_template_color_list_model.dart';
|
|
|
|
import '../models/seller_version_model.dart';
|
|
...
|
...
|
@@ -60,6 +61,176 @@ typedef ClickCallback = void Function(String value); |
|
|
|
// };
|
|
|
|
|
|
|
|
class DialogUtil {
|
|
|
|
static List<Widget> dishSelectBtn(
|
|
|
|
List<GetReserveTypeFieldsSunModel> menuSunModel,
|
|
|
|
state,
|
|
|
|
ClickCallback callback) {
|
|
|
|
List<Widget> temp = [];
|
|
|
|
for (int i = 0; i < menuSunModel.length; i++) {
|
|
|
|
GetReserveTypeFieldsSunModel practiceModel = menuSunModel[i];
|
|
|
|
temp.add(InkWell(
|
|
|
|
onTap: () {
|
|
|
|
for (int j = 0; j < menuSunModel.length; j++) {
|
|
|
|
menuSunModel[j].select = false;
|
|
|
|
}
|
|
|
|
menuSunModel[i].select = true;
|
|
|
|
callback(menuSunModel[i].name);
|
|
|
|
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 openDishTypeSelectModalBottomSheet(context,
|
|
|
|
List<GetReserveTypeFieldsSunModel> reserveTypes, String reserveType,
|
|
|
|
{VoidCallback lCallback, ClickCallback rCallback}) async {
|
|
|
|
String selectType = reserveType;
|
|
|
|
if (selectType != '请选择') {
|
|
|
|
reserveTypes.forEach((element) {
|
|
|
|
element.select = false;
|
|
|
|
if (element.name == selectType) {
|
|
|
|
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: () {
|
|
|
|
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: dishSelectBtn(reserveTypes, state, (value) {
|
|
|
|
selectType = value;
|
|
|
|
})),
|
|
|
|
VEmptyView(50),
|
|
|
|
]));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
reserveTypes.forEach((element) {
|
|
|
|
element.select = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
static showAuthorityDestination(
|
|
|
|
BuildContext context, String name, String title, String subTitle) async {
|
|
|
|
Timer _timer = Timer(const Duration(seconds: 5), () {
|
...
|
...
|
|