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

Flutter build fails after upgrade to flow_builder-0.0.7 #93

Closed
GerhardMalan opened this issue May 12, 2022 · 4 comments
Closed

Flutter build fails after upgrade to flow_builder-0.0.7 #93

GerhardMalan opened this issue May 12, 2022 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@GerhardMalan
Copy link

Describe the bug
Flutter build fails after upgrade to flow_builder-0.0.7 from flow_builder-0.0.6.

To Reproduce
Steps to reproduce the behavior:

  1. Upgrade to flow_builder-0.0.7 from flow_builder-0.0.6.
  2. Run app (F5)
  3. Build fails with error messages below:
  4. Fixed the problem by directly editing C:\sdk\flutter.pub-cache\hosted\pub.dartlang.org\flow_builder-0.0.7\lib\flow_builder.dart, lines 367 and 372, adding null operator [?] after WidgetsBinding.instance?

/C:/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flow_builder-0.0.7/lib/flow_builder.dart:367:36: Error: Method 'handlePopRoute' cannot be called on 'WidgetsBinding?' because it is potentially null.

  • 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/sdk/flutter/packages/flutter/lib/src/widgets/binding.dart').
    package:flutter/…/widgets/binding.dart:1
    Try calling using ?. instead.
    return WidgetsBinding.instance.handlePopRoute();
    ^^^^^^^^^^^^^^
    /C:/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/flow_builder-0.0.7/lib/flow_builder.dart:372:38: Error: Method 'handlePushRoute' cannot be called on 'WidgetsBinding?' because it is potentially null.

  • 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('/C:/sdk/flutter/packages/flutter/lib/src/widgets/binding.dart').
    package:flutter/…/widgets/binding.dart:1
    Try calling using ?. instead.
    return WidgetsBinding.instance.handlePushRoute(arguments);

@felangel
Copy link
Owner

Hi @GerhardMalan 👋
Thanks for opening an issue!

I think this must have been a subtle breaking change introduced in Flutter 3.0.0. Can you upgrade to the latest stable channel of Flutter (3.0.0) and let me know if the issue persists? Thanks and sorry for the inconvenience!

@felangel felangel self-assigned this May 12, 2022
@felangel felangel added question Further information is requested waiting for response Waiting for additional information labels May 12, 2022
@GerhardMalan
Copy link
Author

Sure, we'll have a go. Our app has a fair few library imports, so there may well be other conflicts. Thanks for the quick response.

I'll get back to you after upgrading Felix.

@GerhardMalan
Copy link
Author

Ok, that's fixed it, thanks. Have two libraries (latest versions) that compile with warnings due to the now unnecessary null-aware operators on WidgetsBinding.instance, but that's not a big deal for now:

  • flutter_typeahead-3.2.5,
  • cached_network_image-3.2.0

Thanks for the help and quick response Felix!

@felangel
Copy link
Owner

Ok, that's fixed it, thanks. Have two libraries (latest versions) that compile with warnings due to the now unnecessary null-aware operators on WidgetsBinding.instance, but that's not a big deal for now:

  • flutter_typeahead-3.2.5,
  • cached_network_image-3.2.0

Thanks for the help and quick response Felix!

Awesome, glad to hear it!

@felangel felangel removed the waiting for response Waiting for additional information label May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants