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

Use analyzer.language instead of analyzer.strong-mode #46

Closed
maRci002 opened this issue May 26, 2022 · 1 comment · Fixed by #47
Closed

Use analyzer.language instead of analyzer.strong-mode #46

maRci002 opened this issue May 26, 2022 · 1 comment · Fixed by #47
Assignees
Labels
feature A new feature or request

Comments

@maRci002
Copy link

v3.0.0 version supports Dart ^2.17.0

These lines:

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

Should be changed to:

  language:
    strict-casts: true
    strict-inference: true
    strict-raw-types: true

Source:
https://dart.dev/guides/language/analysis-options#enabling-additional-type-checks

@maRci002
Copy link
Author

maRci002 commented May 26, 2022

Note: strict-inference: true might be pain for someone.

Consider these two examples:
Future.delayed(const Duration(seconds: 1));
Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) => const Scaffold()));

In case of strict-inference: true this should look like this:
Future<void>.delayed(const Duration(seconds: 1));
Navigator.of(context).push<void>(MaterialPageRoute(builder: (BuildContext context) => const Scaffold()));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants