Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[android_intent] Migrate to nnbd #3328

Merged
merged 2 commits into from
Dec 15, 2020
Merged

[android_intent] Migrate to nnbd #3328

merged 2 commits into from
Dec 15, 2020

Conversation

mehmetf
Copy link
Contributor

@mehmetf mehmetf commented Dec 14, 2020

Description

Migrate android_intent plugin to nnbd.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).

@mehmetf mehmetf requested a review from blasten December 15, 2020 14:18
@@ -36,7 +36,7 @@ class AndroidIntent {
this.arguments,
this.package,
this.componentName,
Platform platform,
Platform? platform,
this.type,
}) : assert(action != null || componentName != null,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you remind me why assert is still needed in g3?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This particular assert is useful because it checks that either action or componentName is non-null. Therefore, both are nullable.

For non-nullable vars, asserts are useful for mixed mode. If an app that is not yet migrated uses a null-safe library, they can still pass null to a non-nullable type. This will eventually fail with a _CastError if we remove the asserts. The assert is more explicit and meaningful. When most code in Dart ecosystem is migrated to null-safety and/or we have had a couple of stable releases of nnbd, we can start cleaning up the asserts. package:flutter is following the same thing.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! thanks

Copy link

@blasten blasten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mehmetf mehmetf merged commit f8a53a5 into flutter:master Dec 15, 2020
@mehmetf mehmetf deleted the android_intent_nnbd branch December 15, 2020 17:54
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 15, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 15, 2020
NickalasB added a commit to NickalasB/plugins that referenced this pull request Dec 15, 2020
* master:
  [android_intent] Migrate to nnbd (flutter#3328)
  [share] Migrate to null-safety (flutter#3311)
  [webview_flutter] Migrate to nnbd (flutter#3327)

# Conflicts:
#	packages/webview_flutter/CHANGELOG.md
#	packages/webview_flutter/lib/platform_interface.dart
#	packages/webview_flutter/lib/webview_flutter.dart
#	packages/webview_flutter/pubspec.yaml
#	packages/webview_flutter/test/webview_flutter_test.dart
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 16, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 16, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 16, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 16, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 17, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 18, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 18, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 18, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 18, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 18, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 19, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 19, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 19, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 20, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 29, 2020
amantoux pushed a commit to amantoux/plugins that referenced this pull request Feb 8, 2021
adsonpleal pushed a commit to nubank/plugins that referenced this pull request Feb 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants