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

[connectivity_platform_interface] Remove Platform asserts. #2715

Merged
merged 1 commit into from
Apr 28, 2020

Conversation

ditman
Copy link
Member

@ditman ditman commented Apr 28, 2020

Description

Even though the code path never hits web targets, having dart:io imports in the MethodChannel implementation in the platform_interface package breaks the pana analysis of federated implementations for platforms where those imports are forbidden (like web), with something similar to this:

$~/connectivity/experimental_connectivity_web does not support flutter with runtime: flutter-web because of import violation at: 

package:experimental_connectivity_web/experimental_connectivity_web.dart,
package:experimental_connectivity_web/src/network_information_api_connectivity_plugin.dart,
package:experimental_connectivity_web/src/utils/connectivity_result.dart,
package:connectivity_platform_interface/connectivity_platform_interface.dart,
package:connectivity_platform_interface/src/method_channel_connectivity.dart, 
dart:io

This change removes the Platform check assert (if deemed critical, it should be added to the connectivity plugin, or maybe hidden behind a conditional import in this package).

All current tests, both in connectivity_platform_interface and connectivity pass.

Related Issues

n/a

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?

  • No, this is not a breaking change.

Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

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

LGTM

@ditman ditman merged commit f270b85 into flutter:master Apr 28, 2020
@ditman ditman deleted the connectivity-use-package-platform branch April 28, 2020 23:52
EdwinRomelta pushed a commit to EdwinRomelta/plugins that referenced this pull request Jun 11, 2020
…Channel. (flutter#2715)

Having dart:io imports in the MethodChannel implementation breaks the pana analysis of federated implementations for platforms where those imports are forbidden (like web).

This change removes the Platform check asserts from the MethodChannel implementation.
jorgefspereira pushed a commit to jorgefspereira/plugins_flutter that referenced this pull request Oct 10, 2020
…Channel. (flutter#2715)

Having dart:io imports in the MethodChannel implementation breaks the pana analysis of federated implementations for platforms where those imports are forbidden (like web).

This change removes the Platform check asserts from the MethodChannel implementation.
FlutterSu pushed a commit to FlutterSu/flutter-plugins that referenced this pull request Nov 20, 2020
…Channel. (flutter#2715)

Having dart:io imports in the MethodChannel implementation breaks the pana analysis of federated implementations for platforms where those imports are forbidden (like web).

This change removes the Platform check asserts from the MethodChannel implementation.
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.

3 participants