File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,15 @@ class MyHomePageState extends State<MyHomePage> {
85
85
() => _useCustomFileViewer = ! _useCustomFileViewer);
86
86
},
87
87
),
88
+ const Spacer (),
89
+ ElevatedButton (
90
+ child: const Text ('Reset' ),
91
+ onPressed: () {
92
+ setState (
93
+ () => _formKey.currentState! .reset (),
94
+ );
95
+ },
96
+ ),
88
97
],
89
98
),
90
99
],
Original file line number Diff line number Diff line change @@ -248,7 +248,6 @@ class _FormBuilderFilePickerState
248
248
final itemSize =
249
249
(constraints.biggest.width - (count * spacing)) / count;
250
250
return Wrap (
251
- // scrollDirection: Axis.horizontal,
252
251
alignment: WrapAlignment .start,
253
252
runAlignment: WrapAlignment .start,
254
253
runSpacing: 10 ,
@@ -352,4 +351,10 @@ class _FormBuilderFilePickerState
352
351
return Icons .insert_drive_file;
353
352
}
354
353
}
354
+
355
+ @override
356
+ void reset () {
357
+ super .reset ();
358
+ setState (() => _files = widget.initialValue ?? []);
359
+ }
355
360
}
You can’t perform that action at this time.
0 commit comments