Skip to content

Commit cd384c5

Browse files
style: format to new dart style
1 parent 0f79c22 commit cd384c5

File tree

1 file changed

+37
-36
lines changed

1 file changed

+37
-36
lines changed

example/lib/main.dart

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ class MyHomePageState extends State<MyHomePage> {
3131
@override
3232
Widget build(BuildContext context) {
3333
return Scaffold(
34-
appBar: AppBar(
35-
title: const Text('FormBuilder FilePicker Example'),
36-
),
34+
appBar: AppBar(title: const Text('FormBuilder FilePicker Example')),
3735
body: Padding(
3836
padding: const EdgeInsets.all(10),
3937
child: FormBuilder(
@@ -56,19 +54,21 @@ class MyHomePageState extends State<MyHomePage> {
5654
Text('Upload'),
5755
],
5856
),
59-
)
57+
),
6058
],
61-
customTypeViewerBuilder: (children) => Row(
62-
mainAxisAlignment: MainAxisAlignment.end,
63-
children: children,
64-
),
59+
customTypeViewerBuilder:
60+
(children) => Row(
61+
mainAxisAlignment: MainAxisAlignment.end,
62+
children: children,
63+
),
6564
onFileLoading: (val) {
6665
debugPrint(val.toString());
6766
},
68-
customFileViewerBuilder: _useCustomFileViewer
69-
? (files, filesSetter) =>
70-
customFileViewerBuilder(files ?? [], (newValue) {})
71-
: null,
67+
customFileViewerBuilder:
68+
_useCustomFileViewer
69+
? (files, filesSetter) =>
70+
customFileViewerBuilder(files ?? [], (newValue) {})
71+
: null,
7272
),
7373
const SizedBox(height: 20),
7474
Row(
@@ -83,21 +83,22 @@ class MyHomePageState extends State<MyHomePage> {
8383
),
8484
const Spacer(),
8585
ElevatedButton(
86-
child: Text(_useCustomFileViewer
87-
? 'Use Default File Viewer'
88-
: 'Use Custom File Viewer'),
86+
child: Text(
87+
_useCustomFileViewer
88+
? 'Use Default File Viewer'
89+
: 'Use Custom File Viewer',
90+
),
8991
onPressed: () {
9092
setState(
91-
() => _useCustomFileViewer = !_useCustomFileViewer);
93+
() => _useCustomFileViewer = !_useCustomFileViewer,
94+
);
9295
},
9396
),
9497
const Spacer(),
9598
ElevatedButton(
9699
child: const Text('Reset'),
97100
onPressed: () {
98-
setState(
99-
() => _formKey.currentState!.reset(),
100-
);
101+
setState(() => _formKey.currentState!.reset());
101102
},
102103
),
103104
],
@@ -116,22 +117,22 @@ class MyHomePageState extends State<MyHomePage> {
116117
return files.isEmpty
117118
? const Center(child: Text('No files'))
118119
: ListView.separated(
119-
shrinkWrap: true,
120-
itemBuilder: (context, index) {
121-
return ListTile(
122-
title: Text(files[index].name),
123-
trailing: IconButton(
124-
icon: const Icon(Icons.delete),
125-
onPressed: () {
126-
files.removeAt(index);
127-
setter.call([...files]);
128-
},
129-
),
130-
);
131-
},
132-
separatorBuilder: (context, index) =>
133-
const Divider(color: Colors.blueAccent),
134-
itemCount: files.length,
135-
);
120+
shrinkWrap: true,
121+
itemBuilder: (context, index) {
122+
return ListTile(
123+
title: Text(files[index].name),
124+
trailing: IconButton(
125+
icon: const Icon(Icons.delete),
126+
onPressed: () {
127+
files.removeAt(index);
128+
setter.call([...files]);
129+
},
130+
),
131+
);
132+
},
133+
separatorBuilder:
134+
(context, index) => const Divider(color: Colors.blueAccent),
135+
itemCount: files.length,
136+
);
136137
}
137138
}

0 commit comments

Comments
 (0)