Skip to content

Commit 2e66a16

Browse files
committed
added deprecated annotation and docs for removing the fields
1 parent 35db911 commit 2e66a16

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/src/form_builder_file_picker.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class TypeSelector {
2424
final FileType type;
2525
final Widget selector;
2626

27-
TypeSelector({required this.type, required this.selector});
27+
const TypeSelector({required this.type, required this.selector});
2828
}
2929

3030
/// Field for image(s) from user device storage
@@ -91,8 +91,13 @@ class FormBuilderFilePicker extends FormBuilderField<List<PlatformFile>> {
9191
this.withReadStream = false,
9292
this.allowMultiple = false,
9393
this.previewImages = true,
94-
this.selector = const Icon(Icons.add_circle),
95-
this.type = FileType.any,
94+
@Deprecated("please use typeSelectors for better picker and file type control")
95+
this.selector = const Icon(Icons.add_circle),
96+
@Deprecated("please use typeSelectors for better picker and file type control")
97+
this.type = FileType.any,
98+
// TODO: once the above fields are removed typeSelectors should be made not null and initialized as
99+
// const [TypeSelector(type: FileType.any, selector: Icon(Icons.add_circle))]
100+
// the typeSelectorList variable can be then removed and we can use typeSelectors directly
96101
this.typeSelectors,
97102
this.allowedExtensions,
98103
this.onFileLoading,

0 commit comments

Comments
 (0)