@@ -17,7 +17,7 @@ import 'image_source_sheet.dart';
17
17
///
18
18
/// if you want to use a different object (e.g. a class from the backend that has imageId and imageUrl)
19
19
/// you need to implement [displayCustomType]
20
- class FormBuilderImagePicker extends FormBuilderField <List <dynamic >> {
20
+ class FormBuilderImagePicker extends FormBuilderFieldDecoration <List <dynamic >> {
21
21
/// set to true to insert an [InputDecorator] which displays labels, borders, etc...
22
22
///
23
23
/// when [maxImages] == 1, it's better to set this to false
@@ -331,9 +331,8 @@ class FormBuilderImagePicker extends FormBuilderField<List<dynamic>> {
331
331
if (index < value.length) {
332
332
final item = value[index];
333
333
return itemBuilder (context, item, index);
334
- } else {
335
- return addButtonBuilder (context);
336
334
}
335
+ return addButtonBuilder (context);
337
336
},
338
337
),
339
338
);
@@ -353,8 +352,8 @@ class FormBuilderImagePicker extends FormBuilderField<List<dynamic>> {
353
352
FormBuilderImagePickerState createState () => FormBuilderImagePickerState ();
354
353
}
355
354
356
- class FormBuilderImagePickerState
357
- extends FormBuilderFieldState < FormBuilderImagePicker , List <dynamic >> {
355
+ class FormBuilderImagePickerState extends FormBuilderFieldDecorationState <
356
+ FormBuilderImagePicker , List <dynamic >> {
358
357
List <dynamic > get effectiveValue =>
359
358
value? .where ((element) => element != null ).toList () ?? [];
360
359
@@ -366,11 +365,11 @@ class FormBuilderImagePickerState
366
365
367
366
class XFileImage extends StatefulWidget {
368
367
const XFileImage ({
369
- Key ? key,
368
+ super . key,
370
369
required this .file,
371
370
this .fit,
372
371
this .loadingWidget,
373
- }) : super (key : key) ;
372
+ });
374
373
final XFile file;
375
374
final BoxFit ? fit;
376
375
final WidgetBuilder ? loadingWidget;
0 commit comments