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 support for generated files #75

Closed
mark-nicepants opened this issue Jan 25, 2021 · 3 comments
Closed

Null safety support for generated files #75

mark-nicepants opened this issue Jan 25, 2021 · 3 comments
Milestone

Comments

@mark-nicepants
Copy link

When I run the generator against a project with sdk constraints set to a version with nullability on (>=2.12-0-0) I expect that the generated code is compatible with the null safety features. It is not at the moment.

I created a bash script workaround that will add the @dart=2.10 comment on top.

#!/bin/bash

fluttergen

sed -i '' '1 s/^/\/\/@dart=2.10\n/' lib/core/assets/assets.gen.dart

I currently don't have time to submit a PR with updated functionality, but if someone else is struggling with this, they can use the workaround until a compatible version is released.

@wasabeef wasabeef added this to the 2.0.0 milestone Feb 18, 2021
wasabeef added a commit that referenced this issue Feb 20, 2021
chore(generator): workaround nnbd #75
@britannio
Copy link

@wasabeef Any eta on generating null safe code?

@wasabeef
Copy link
Member

@britannio
It will be released in a few days.
#91

@wasabeef
Copy link
Member

@mark-apn @britannio

I'm sorry for the late reply.

Just now we released v3.0.2 null safety so could you try it?

  • Null Safety
  • Rename package for build_runner
flutter_gen:
  null_safety: true # Optional (default: true)

dev_dependencies:
  build_runner: 
  flutter_gen_runner: ^3.0.2 # Since v2, renamed

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