[connectivity] Migrate more logic to method channel platform#2526
[connectivity] Migrate more logic to method channel platform#2526ditman merged 11 commits intoflutter:masterfrom
Conversation
…plementation. connectivity_platform_interface: * Bring ConnectivityResult and LocationAuthorizationStatus enums from core package. * Use the above Enums as return values for ConnectivityPlatformInterface methods. * Modify the MethodChannel implementation so it returns the right types. * Bring utility methods, asserts and other logic that is only needed on the MethodChannel implementation from the core package, so it's simpler. * Bring MethodChannel unit tests from core package. connectivity (core pkg): * Reexport ConnectivityResult and LocationAuthorizationStatus enums so plugin users can see them. * Remove MethodChannel unit tests (moved to platform_interface).
|
Mostly @ditman work, but happy to take the credit :) |
|
@franciscojma86 you can't push changes to two packages at the same time, because our testing won't know what you do. You first need to PR and release the changes to the |
ditman
left a comment
There was a problem hiding this comment.
Please, remove changes from the core connectivity package, so this PR just changes the connectivity_platform_interface package.
| }) { | ||
| // `assert(Platform.isIOS)` will prevent us from doing dart side unit testing. | ||
| // TODO: These should noop for non-Android, instead of throwing, so people don't need to rely on dart:io for this. | ||
| assert(!Platform.isAndroid); |
There was a problem hiding this comment.
I thought about this a little bit, and we need to remove these Platform asserts, they don't add anything to this plugin (other than a dependency in dart:io).
We can do this in other PR, though.
There was a problem hiding this comment.
Yeah I thought so too, but I think the first changes I'd like to keep the API as similar as possible to the current behavior.
…from the core package (flutter#2526) * Bring ConnectivityResult and LocationAuthorizationStatus enums from core package. * Use the above Enums as return values for ConnectivityPlatformInterface methods. * Modify the MethodChannel implementation so it returns the right types. * Bring utility methods, asserts and other logic that is only needed on the MethodChannel implementation from the core package, so it's simpler. * Bring MethodChannel unit tests from core package. Co-authored-by: David Iglesias <ditman@gmail.com>
…from the core package (flutter#2526) * Bring ConnectivityResult and LocationAuthorizationStatus enums from core package. * Use the above Enums as return values for ConnectivityPlatformInterface methods. * Modify the MethodChannel implementation so it returns the right types. * Bring utility methods, asserts and other logic that is only needed on the MethodChannel implementation from the core package, so it's simpler. * Bring MethodChannel unit tests from core package. Co-authored-by: David Iglesias <ditman@gmail.com>
…from the core package (flutter#2526) * Bring ConnectivityResult and LocationAuthorizationStatus enums from core package. * Use the above Enums as return values for ConnectivityPlatformInterface methods. * Modify the MethodChannel implementation so it returns the right types. * Bring utility methods, asserts and other logic that is only needed on the MethodChannel implementation from the core package, so it's simpler. * Bring MethodChannel unit tests from core package. Co-authored-by: David Iglesias <ditman@gmail.com>
Description
An improvement over the current platform_interface implementation, migrating more logic into the method channel platform.
Related Issues
flutter/flutter#46307
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.///).flutter analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?