Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect kIsWeb usage instead of withData #65

Merged
merged 1 commit into from
Jun 14, 2023

Conversation

divan
Copy link
Contributor

@divan divan commented Jun 13, 2023

I was using this widget with image preview with data bytes being available on MacOS platform. There is a field called withData to signal widget that bytes are available. Default value equals to kIsWeb.

Somehow instead of using withData on

, kIsWeb was used. So on MacOS platform this was trying to read file from path (which is null) instead of bytes. That resulted in a red error box and stacktrace:

Another exception was thrown: Null check operator used on a null value
Another exception was thrown: A RenderFlex overflowed by 99827 pixels on the bottom.


══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following _TypeError was thrown building LayoutBuilder:
Null check operator used on a null value

The relevant error-causing widget was:
  LayoutBuilder
  LayoutBuilder:file:///Users/divan/.pub-cache/hosted/pub.dev/form_builder_file_picker-4.0.0/lib/src/form_builder_file_picker.dart:220:12

When the exception was thrown, this was the stack:
#0      _FormBuilderFilePickerState.defaultFileViewer.<anonymous closure>.<anonymous closure> (package:form_builder_file_picker/src/form_builder_file_picker.dart:249:66)
#1      new _GrowableList.generate (dart:core-patch/growable_array.dart:136:28)
#2      _FormBuilderFilePickerState.defaultFileViewer.<anonymous closure> (package:form_builder_file_picker/src/form_builder_file_picker.dart:231:26)

@deandreamatias deandreamatias merged commit eee7332 into flutter-form-builder-ecosystem:main Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants