Skip to content

Commit ee16639

Browse files
committed
[TASK] Apply dart format
1 parent 21a0007 commit ee16639

File tree

1 file changed

+44
-42
lines changed

1 file changed

+44
-42
lines changed

lib/src/form_builder_file_picker.dart

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -75,34 +75,35 @@ class FormBuilderFilePicker
7575
final Widget Function(List<Widget> types)? customTypeViewerBuilder;
7676

7777
/// Creates field for image(s) from user device storage
78-
FormBuilderFilePicker({
79-
//From Super
80-
super.key,
81-
required super.name,
82-
super.validator,
83-
super.initialValue,
84-
super.decoration,
85-
super.onChanged,
86-
super.valueTransformer,
87-
super.enabled,
88-
super.onSaved,
89-
super.autovalidateMode = AutovalidateMode.disabled,
90-
super.onReset,
91-
super.focusNode,
92-
this.maxFiles,
93-
this.withData = kIsWeb,
94-
this.withReadStream = false,
95-
this.allowMultiple = false,
96-
this.previewImages = true,
97-
this.typeSelectors = const [
98-
TypeSelector(type: FileType.any, selector: Icon(Icons.add_circle))
99-
],
100-
this.allowedExtensions,
101-
this.onFileLoading,
102-
this.allowCompression = true,
103-
this.customFileViewerBuilder,
104-
this.customTypeViewerBuilder
105-
}) : super(
78+
FormBuilderFilePicker(
79+
{
80+
//From Super
81+
super.key,
82+
required super.name,
83+
super.validator,
84+
super.initialValue,
85+
super.decoration,
86+
super.onChanged,
87+
super.valueTransformer,
88+
super.enabled,
89+
super.onSaved,
90+
super.autovalidateMode = AutovalidateMode.disabled,
91+
super.onReset,
92+
super.focusNode,
93+
this.maxFiles,
94+
this.withData = kIsWeb,
95+
this.withReadStream = false,
96+
this.allowMultiple = false,
97+
this.previewImages = true,
98+
this.typeSelectors = const [
99+
TypeSelector(type: FileType.any, selector: Icon(Icons.add_circle))
100+
],
101+
this.allowedExtensions,
102+
this.onFileLoading,
103+
this.allowCompression = true,
104+
this.customFileViewerBuilder,
105+
this.customTypeViewerBuilder})
106+
: super(
106107
builder: (FormFieldState<List<PlatformFile>?> field) {
107108
final state = field as _FormBuilderFilePickerState;
108109

@@ -114,11 +115,13 @@ class FormBuilderFilePicker
114115
child: Column(
115116
children: <Widget>[
116117
customTypeViewerBuilder != null
117-
? customTypeViewerBuilder(state.getTypeSelectorActions(typeSelectors, field))
118+
? customTypeViewerBuilder(
119+
state.getTypeSelectorActions(typeSelectors, field))
118120
: Row(
119-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
120-
children: state.getTypeSelectorActions(typeSelectors, field),
121-
),
121+
mainAxisAlignment: MainAxisAlignment.spaceBetween,
122+
children: state.getTypeSelectorActions(
123+
typeSelectors, field),
124+
),
122125
const SizedBox(height: 3),
123126
customFileViewerBuilder != null
124127
? customFileViewerBuilder.call(state._files,
@@ -300,18 +303,17 @@ class _FormBuilderFilePickerState extends FormBuilderFieldDecorationState<
300303
);
301304
}
302305

303-
List<Widget> getTypeSelectorActions(List<TypeSelector> typeSelectors, FormFieldState<List<PlatformFile>?> field) {
306+
List<Widget> getTypeSelectorActions(List<TypeSelector> typeSelectors,
307+
FormFieldState<List<PlatformFile>?> field) {
304308
return <Widget>[
305309
...typeSelectors.map(
306-
(typeSelector) =>
307-
InkWell(
308-
onTap: enabled &&
309-
(null == _remainingItemCount ||
310-
_remainingItemCount! > 0)
311-
? () => pickFiles(field, typeSelector.type)
312-
: null,
313-
child: typeSelector.selector,
314-
),
310+
(typeSelector) => InkWell(
311+
onTap: enabled &&
312+
(null == _remainingItemCount || _remainingItemCount! > 0)
313+
? () => pickFiles(field, typeSelector.type)
314+
: null,
315+
child: typeSelector.selector,
316+
),
315317
),
316318
];
317319
}

0 commit comments

Comments
 (0)