flutter-form-builder-ecosystem / form_builder_file_picker

File picker field widget for FlutterFormBuilder.
https://pub.dev/packages/form_builder_file_picker
BSD 3-Clause "New" or "Revised" License
15 stars 33 forks source link

files reset when state change #56

Open yudomaryanto opened 1 year ago

yudomaryanto commented 1 year ago

Environment

Package version:
form_builder_file_picker: ^2.3.0

Flutter doctor - Doctor summary (to see all details, run flutter doctor -v): - [✓] Flutter (Channel stable, 3.7.0, on macOS 13.2 22D49 darwin-arm64, locale en-ID) - [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1) - [✓] Xcode - develop for iOS and macOS (Xcode 14.2) - [✓] Chrome - develop for the web - [✓] Android Studio (version 2022.1) - [✓] VS Code (version 1.75.0) - [✓] Connected device (3 available) - [✓] HTTP Host Availability ``` ```
Code sample ``` if (type == 'filepicker') { return FormBuilderFilePicker( name: 'filepicker_datum$page', validator: FormBuilderValidators.required(errorText: 'Jawaban wajib diisi!'), decoration: const InputDecoration(labelText: 'Attachments'), maxFiles: 1, previewImages: true, onChanged: (val) {}, typeSelectors: [ TypeSelector( type: FileType.any, selector: Row( children: const [ Icon(Icons.attachment), Gap(8), Text('Pilih Berkas'), ], ), ) ], onFileLoading: (val) { debugPrint(val.toString()); }, onSaved: (newValue) {}, // customFileViewerBuilder: customFileViewerBuilder, ); } ```

Description

i am using pageview, when finished fetching files, the list of files that have been fetxhed is reset to null.

Expected behavior: file lists persists

Current behavior: files reset

Video

https://user-images.githubusercontent.com/111847308/218387741-ac248f22-27d7-434b-8350-d2bc41b6a46b.mp4

deandreamatias commented 1 year ago

@yudomaryanto please fill all info in the template (flutter doctor, minimal code sample and package version) Thanks

yudomaryanto commented 1 year ago

@yudomaryanto please fill all info in the template (flutter doctor, minimal code sample and package version) Thanks

done update, thanks

deandreamatias commented 1 year ago

Hi @yudomaryanto This happens with other fields of FlutterFormBuilder package? I don't sure if this is related to the field our to your state management implementation

OmarZakiAli commented 5 months ago

I have same issue , it only occurs with this field