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

Extension broken with recent updates in Dev channel #66

Closed
maxim-saplin opened this issue Feb 1, 2021 · 13 comments · Fixed by #67
Closed

Extension broken with recent updates in Dev channel #66

maxim-saplin opened this issue Feb 1, 2021 · 13 comments · Fixed by #67

Comments

@maxim-saplin
Copy link

Target dart2js failed: Exception: ../../../hostedtoolcache/flutter/1.22.0-12.0.pre-dev/x64/.pub-cache/hosted/pub.dartlang.org/i18n_extension-1.5.1/lib/i18n_widget.dart:197:59:
15
Error: No named parameter with the name 'nullOk'.
16
    var newSystemLocale = Localizations.localeOf(context, nullOk: true);
17
                                                          ^^^^^^
18
../../../hostedtoolcache/flutter/1.22.0-12.0.pre-dev/x64/packages/flutter/lib/src/widgets/localizations.dart:413:17:
19
Info: Found this candidate, but the arguments don't match.
20
  static Locale localeOf(BuildContext context) {
21
                ^^^^^^^^

The breaking changes might be coming to other channels:

flutter/flutter#74519

@danilo108
Copy link

I have the same problem. Is there a quick fix for this?

@maxim-saplin
Copy link
Author

You can downgrade flutter https://stackoverflow.com/a/65857155/440696

@rydmike
Copy link

rydmike commented Feb 1, 2021

No quick fix in sight with the current incompatibilities between channel stable and beta/dev/master, caused by NNBD.

Heard an indication that something might be in the works, but it was very vague.

Might be that this is not resolved until NNBD hits stable and everybody must change to "maybeOf" to be able to use latest stable.

Perhaps if "maybeOf" is introduced into stable as a hotfix and "nullOK" is deprecated and everybody can migrate to "maybeOf", then there is at least something users of "nullOK" can do to fix it. Currently there is nothing users of "nullOK" can do to support all channels with the same code base. They can offer forked version of the package, one that uses "nullOK" on stable and "maybeOf" on other news versions/channels of the Flutter SDK, but that is a extra work to do an maintain.

flutter/flutter#74519 (comment)

@maxim-saplin
Copy link
Author

maxim-saplin commented Feb 2, 2021

Is it worth creating a null-safe version of the extenison the way it is done with other extensions on pub.dev (x.x.x-nullsafety.0)?

image

@marcglasberg
Copy link
Owner

Yes, it is worth doing it, but as far as I know, NNBD will be going to stable soon. I will start updating all my 13 packages as soon as this happens. Until then, I am accepting PRs. If you have the time and knowledge to help update the package, please do.

@creativecreatorormaybenot
Copy link
Contributor

You can use:

i18n_extension:
  git:
    url: https://github.com/simpleclub-extended/i18n_extension
    ref: maybe-of

Until #67 is merged.

@nerder
Copy link

nerder commented Feb 10, 2021

Hey @marcglasberg any news on when this will be merged?

@danilo108
Copy link

Hi everyone, any plan for merging this 67 soon?

@marcglasberg
Copy link
Owner

Sorry, as far as I understand pub.dev doesn't allow different versions for stable and dev. If I accept this change now won't it break the package for 90% of it's users, since they are in stable?

@nerder
Copy link

nerder commented Feb 10, 2021

@marcglasberg what you should do is to publish a pre-release https://dart.dev/tools/pub/publishing#publishing-prereleases

So at the end it should look like this:

image

So that users in stable can keep use the package and users in dev or beta (this is breaking for beta also right now) can upgrade to the pre-release safely

@marcglasberg
Copy link
Owner

@nerder Got it. I hadn't noticed that pub.dev actually now does allow different versions like this.

@marcglasberg
Copy link
Owner

Published version: i18n_extension 3.0.0-dev.1

@nerder
Copy link

nerder commented Feb 11, 2021

Thank you so much @marcglasberg happy to help

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 a pull request may close this issue.

6 participants