Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
assert
  • Loading branch information
Chris Yang committed Aug 22, 2019
commit 17f69cfae06b0aaaa095abea9d99d2dbee66cf67
5 changes: 1 addition & 4 deletions packages/connectivity/lib/connectivity.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,7 @@ class Connectivity {
/// This method will throw on Android.
Future<LocationAuthorizationStatus> requestLocationServiceAuthorizationIfUndetermined({bool requestAlwaysLocationUsage = false}) async {
//Just `assert(Platform.isIOS)` will disable us to do dart side unit testing.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
//Just `assert(Platform.isIOS)` will disable us to do dart side unit testing.
// Just `assert(Platform.isIOS)` will prevent us from doing Dart side unit testing.

if (Platform.isAndroid) {
throw UnsupportedError(
'The method requestLocationServiceIfUndetermined is not supported on android');
}
assert(!Platform.isAndroid);
final String result = await methodChannel
.invokeMethod<String>('requestLocationServiceAuthorizationIfUndetermined', <bool>[requestAlwaysLocationUsage]);
switch (result) {
Expand Down