|
...
|
...
|
@@ -124,6 +124,102 @@ class DialogUtil { |
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
static Future openFTablesDialog(BuildContext context, List<t.Table> tables,
|
|
|
|
{CustomCallBack onTap}) async {
|
|
|
|
final action = await showDialog(
|
|
|
|
context: context,
|
|
|
|
barrierDismissible: true,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
return Center(
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil().setWidth(400),
|
|
|
|
width: ScreenUtil().setWidth(280 * 2),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10))),
|
|
|
|
child: Card(
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
Radius.circular(ScreenUtil().setWidth(10)))), //设置圆角
|
|
|
|
child: Column(children: [
|
|
|
|
Expanded(
|
|
|
|
child: ListView(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40),
|
|
|
|
vertical: ScreenUtil().setWidth(40)),
|
|
|
|
shrinkWrap: true,
|
|
|
|
children: [
|
|
|
|
Wrap(
|
|
|
|
children: tableListWidget(tables, (v) {}),
|
|
|
|
spacing: ScreenUtil().setWidth(20),
|
|
|
|
runSpacing: ScreenUtil().setWidth(20),
|
|
|
|
// alignment: WrapAlignment.start,
|
|
|
|
// runAlignment: WrapAlignment.end,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
MyDivider(double.infinity, ScreenUtil().setWidth(2)),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: ScreenUtil().setWidth(40)),
|
|
|
|
child: Text('确定',
|
|
|
|
style: TextStyle(
|
|
|
|
color: Color.fromRGBO(42, 96, 244, 1),
|
|
|
|
fontSize: ScreenUtil().setSp(30))),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
])),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// static Future openFTablesDialog(BuildContext context, List<t.Table> tables,
|
|
|
|
// {CustomCallBack onTap}) async {
|
|
|
|
// TextEditingController controller = TextEditingController();
|
|
|
|
// final action = await showDialog(
|
|
|
|
// context: context,
|
|
|
|
// barrierDismissible: false,
|
|
|
|
// builder: (BuildContext context) {
|
|
|
|
// return Material(
|
|
|
|
// child: Container(
|
|
|
|
// padding: EdgeInsets.symmetric(
|
|
|
|
// horizontal: ScreenUtil().setWidth(40)),
|
|
|
|
// height: ScreenUtil().setWidth(200),
|
|
|
|
// child: Column(
|
|
|
|
// children: [
|
|
|
|
// Wrap(
|
|
|
|
// children: tableListWidget(tables, (v) {}),
|
|
|
|
// spacing: ScreenUtil().setWidth(20),
|
|
|
|
// runSpacing: ScreenUtil().setWidth(20),
|
|
|
|
// // alignment: WrapAlignment.start,
|
|
|
|
// // runAlignment: WrapAlignment.end,
|
|
|
|
// ),
|
|
|
|
// MyDivider(double.infinity, ScreenUtil().setWidth(2)),
|
|
|
|
// InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// Navigator.pop(context);
|
|
|
|
// },
|
|
|
|
// child: Container(
|
|
|
|
// padding: EdgeInsets.symmetric(
|
|
|
|
// vertical: ScreenUtil().setWidth(40)),
|
|
|
|
// child: Text('确定',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: Color.fromRGBO(42, 96, 244, 1),
|
|
|
|
// fontSize: ScreenUtil().setSp(28))),
|
|
|
|
// ),
|
|
|
|
// )
|
|
|
|
// ],
|
|
|
|
// )));
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
|
|
|
|
static Future openCreateAreaDialog(BuildContext context,
|
|
|
|
{CustomCallBack onTap}) async {
|
|
|
|
TextEditingController controller = TextEditingController();
|
|
...
|
...
|
@@ -905,6 +1001,21 @@ class DialogUtil { |
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
static tableListWidget(List<t.Table> tables, CustomCallBack callback) {
|
|
|
|
List<Widget> lists = tables.map((item) {
|
|
|
|
return remarkButton(
|
|
|
|
content: item.name,
|
|
|
|
isSelect: true,
|
|
|
|
onPress: () {
|
|
|
|
// state(() {
|
|
|
|
// item.selected = !item.selected;
|
|
|
|
// });
|
|
|
|
// callback(item);
|
|
|
|
});
|
|
|
|
}).toList();
|
|
|
|
return lists;
|
|
|
|
}
|
|
|
|
|
|
|
|
static listWidget(
|
|
|
|
List<Remark> remarks, StateSetter state, CustomCallBack callback) {
|
|
|
|
List<Widget> lists = remarks.map((item) {
|
...
|
...
|
|