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

Null safety #8

Open
venkatd opened this issue Jun 9, 2021 · 9 comments
Open

Null safety #8

venkatd opened this issue Jun 9, 2021 · 9 comments

Comments

@venkatd
Copy link

venkatd commented Jun 9, 2021

All of our dependencies are null safe so it would be nice for this to be null safe as well. Any chance we could sponsor you for a few hours to upgrade it to null safety?

@anthonychwong
Copy link
Owner

Sure, I can do it sometime next week, but my buy me a coffee book page seems broken for some reason. Will also fix that soon.

@venkatd
Copy link
Author

venkatd commented Jun 10, 2021

Turns out we won't end up using auth0 for our app, but happy to buy you a book anyway. Let me know once it's fixed :)

@anthonychwong
Copy link
Owner

Hey, was studying Type Script for this, and busy for some other things as well. Now here are some update on this.

  • the buy me a coffee book page works now in here https://www.buymeacoffee.com/anthonychwong.
  • because Auth0 API treat null and undefined (variable not set) differently while dart only have null, there are some extra work at the moment to verify proper values are passed to the API or change the wrapper if that is not possible

anthonychwong added a commit that referenced this issue Jul 4, 2021
@anthonychwong
Copy link
Owner

It is now published here 0.0.1-alpha.6.

@anthonychwong
Copy link
Owner

(mis-clicked)

@anthonychwong anthonychwong reopened this Jul 4, 2021
@vanlooverenkoen
Copy link

vanlooverenkoen commented Sep 6, 2021

Not working on our project We get this with

auth0_flutter_web: ^0.0.1-alpha.6

Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:

 - package:auth0_flutter_web

For solutions, see https://dart.dev/go/unsound-null-safety
Unhandled exception:
Bad state: Unsupported Null Safety mode NonNullableByDefaultCompiledMode.Invalid, in null.
#0      ProgramCompiler.emitModule (package:dev_compiler/src/kernel/compiler.dart:442:9)
#1      JavaScriptBundler.compile (package:frontend_server/src/javascript_bundle.dart:146:33)
#2      FrontendCompiler.writeJavascriptBundle (package:frontend_server/frontend_server.dart:638:47)
<asynchronous suspension>
#3      FrontendCompiler.compile (package:frontend_server/frontend_server.dart:549:9)
<asynchronous suspension>
#4      listenAndCompile.<anonymous closure> (package:frontend_server/frontend_server.dart:1119:11)
<asynchronous suspension>
Finished with error: the Dart compiler exited unexpectedly.
Failed to compile application.

This is because the plugin does not support strong-mode

strong-mode:
implicit-casts: false
implicit-dynamic: false

@anthonychwong
Copy link
Owner

@vanlooverenkoen For some reason pud.dev really like the old package 0.0.1-alpha.20210224 a lot and treat this as the latest one, even when checking null safety.

I tried to pin to 0.0.1-alpha.6 (by removing the prefixed head ^), than my testing project compiles. Please let me know if this works for you.

@vanlooverenkoen
Copy link

It has nothing to do with the versions. The plugin does not support strongmode

Add the following to your analyis_options.yml

implicit-casts: false
implicit-dynamic: false

And you will not be able to compile your project.

@anthonychwong
Copy link
Owner

anthonychwong commented Oct 1, 2021

@vanlooverenkoen In my testing project, those are enabled as well. and the output looks well.

> flutter clean
Deleting .dart_tool...                                              21ms
Deleting .packages...                                                3ms

> flutter pub get
Running "flutter pub get" in auth0_flutter_web_testing...        1,253ms

> dart analyze
Analyzing auth0_flutter_web_testing... 7.5s
No issues found!

> flutter build web

💪 Building with sound null safety 💪

Compiling lib/main.dart for the Web...                             47.6s

The testing project is in here

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

No branches or pull requests

3 participants