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

Bug: Not compiling at Flutter Master after latest update #151

Closed
brunodmn opened this issue Nov 28, 2022 · 11 comments
Closed

Bug: Not compiling at Flutter Master after latest update #151

brunodmn opened this issue Nov 28, 2022 · 11 comments
Labels
bug Something isn't working

Comments

@brunodmn
Copy link

Describe the bug
It just stopped compiling after latest Flutter Master upgrade
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. change to master channel with flutter channel master and flutter upgrade
  2. run your application

Additional context

Logs ../../.pub-cache/hosted/pub.dev/introduction_screen-3.1.0/lib/src/introduction_screen.dart:505:35: Error: The method 'elementAtOrNull' is defined in multiple extensions for 'List' and neither is more specific. - 'List' is from 'dart:core'. - 'ScrollController' is from 'package:flutter/src/widgets/scroll_controller.dart' ('../flutter/packages/flutter/lib/src/widgets/scroll_controller.dart'). Try using an explicit extension application of the wanted extension or hiding unwanted extensions from scope. ?.elementAtOrNull(index), ^^^^^^^^^^^^^^^ ../../.pub-cache/hosted/pub.dev/collection-1.17.0/lib/src/list_extensions.dart:271:6: Context: This is one of the extension members. E? elementAtOrNull(int index) => (index < length) ? this[index] : null; ^^^^^^^^^^^^^^^ ../../.pub-cache/hosted/pub.dev/introduction_screen-3.1.0/lib/src/helper.dart:6:6: Context: This is one of the extension members. T? elementAtOrNull(int index) { ^^^^^^^^^^^^^^^ Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

@brunodmn brunodmn added the bug Something isn't working label Nov 28, 2022
@ghenry
Copy link
Collaborator

ghenry commented Nov 28, 2022

Hi @brunodmn

Thanks for this. We only test on flutter stable at the moment.

Gavin.

@ghenry
Copy link
Collaborator

ghenry commented Nov 28, 2022

So when master becomes stable, we'll need to update our helper.

Will leave open and take look when I can.

Thanks for the report.

What features are you using from master anyway?

@brunodmn
Copy link
Author

Hi @ghenry ,

Thank you for quick reply and congrats for the nice job and to share it with us.

I am working on a Material You project and master is quite ahead. I tried to change to stable bug got a bit uglier in design.
My options are redesign or remove your package, if this bug is to hard to fix.
Would be a shame to remove your package as you did such a nice job, but would consume me much less time.
I would totally understand if you consider this not a bug (as it's not showing on stable channel) and close this thread.

Thanks

@ghenry
Copy link
Collaborator

ghenry commented Nov 29, 2022 via email

@kaboc
Copy link

kaboc commented Nov 29, 2022

I'm experiencing the issue in the stable version of Flutter. It occurs if the app project is using package:collection 1.17.0. A quick solution is to using collection 1.16.0.

@ghenry
Copy link
Collaborator

ghenry commented Nov 29, 2022

So it's this:

https://github.com/dart-lang/collection/blob/efd709fc1760a595f8575f4137a1847de1b49d76/lib/src/list_extensions.dart#L270

in latest dart collections, which I guess @Pyozer added because it wasn't there in stable.

@ghenry
Copy link
Collaborator

ghenry commented Nov 29, 2022

I'll commit a change after testing again on stable, but Flutter master is working now. Updated our code to pick the extension:

https://dart.dev/tools/diagnostic-messages?utm_source=dartdev&utm_medium=redir&utm_id=diagcode&utm_content=ambiguous_extension_member_access#ambiguous_extension_member_access

Gavin.

@ghenry ghenry closed this as completed in fc35b58 Nov 29, 2022
@ghenry
Copy link
Collaborator

ghenry commented Nov 29, 2022

That should be you now @brunodmn

I'll get a release prepared, but you might need to run from git for now.

@ghenry
Copy link
Collaborator

ghenry commented Nov 29, 2022

Prepping a new release for you @brunodmn

@ghenry
Copy link
Collaborator

ghenry commented Nov 29, 2022

@brunodmn
Copy link
Author

Worked!
Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants