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

Null Safety #12

Closed S-ecki closed 2 years ago

S-ecki commented 3 years ago

Will there be a null safe version of this package in the near future?

danvick commented 3 years ago

Hi @S-ecki,

I'll be working on a null safe version of this package soon.

Thanks for your patience.

S-ecki commented 3 years ago

Nice, I´m looking forward to it! Thanks for the quick answer!

danvick commented 3 years ago

Version 1.2.0-nullsafety.0 is null safe.

Kindly give feedback if you find any issues.

S-ecki commented 3 years ago

Thanks a lot for the quick follow up! I have tested it and did not find any issues, I will let you know if I do! On another note, I would be very glad if you could check out issue 809 of FlutterFormBuilder, I have opened a PR that should quickly solve the issue. This is my first time contributing to a project, so I am open for any feedback!

tafaust commented 3 years ago

I encountered the following issues:

Launching lib/main.dart on Chrome in debug mode...
../../.pub-cache/hosted/pub.dartlang.org/form_builder_file_picker-1.2.0-nullsafety.0/lib/src/form_builder_file_picke
r.dart:161:36: Error: The argument type 'bool?' can't be assigned to the parameter type 'bool' because 'bool?' is
nullable and 'bool' isn't.
          allowCompression: widget.allowCompression,                    
                                   ^                                    
../../.pub-cache/hosted/pub.dartlang.org/form_builder_file_picker-1.2.0-nullsafety.0/lib/src/form_builder_file_picke
r.dart:242:38: Warning: Operand of null-aware operation '!' has type 'String' which excludes null.
                        files[index].name!,                             
                                     ^                                  
Waiting for connection from debug service on Chrome...             28.1s
Failed to compile application.

which led to a failed compilation of the application. I will provide a PR which attempts to fix the mentioned issue. Please guide me if you need anything. Thank you!

flutterfromscratch commented 3 years ago

I accepted your PR at https://github.com/flutterfromscratch/form_builder_file_picker.

The super-quick workaround is to add a dependency to that repository in your pubspec.yaml by doing this:

form_builder_file_picker: git: https://github.com/flutterfromscratch/form_builder_file_picker

Obviously, when danvick merges your PR and releases a new version we should change back to that.

deandreamatias commented 2 years ago

Version 1.2.0 is full Null safety