-
Notifications
You must be signed in to change notification settings - Fork 1
/
state.txt
44 lines (37 loc) · 1.01 KB
/
state.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
状态变化新增
final GlobalKey<FormState> formKey = GlobalKey<FormState>(); //数据不发生变化关键
PickedFile? pickedFile;
final ImagePicker imagePicker = ImagePicker();
ImageModel imageModel = ImageModel();
Uint8List? imageBytes;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
var form = Form(
key: formKey,
child: Wrap(
children: <Widget>[
_reset() {
this.formData = PersonModel();
formKey.currentState!.reset();
myDS.requestBodyApi.params = formData.toMap();
myDS.loadData();
}
_query() {
formKey.currentState?.save();
myDS.requestBodyApi.params = formData.toMap();
myDS.loadData();
}
----------------------------------------------------
static fullscreenDialog(Widget widget) {
return Navigator.push<void>(
Cry.context,
MaterialPageRoute(
builder: (_) => widget,
fullscreenDialog: true,
),
);
}