-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[wifi_info_flutter_plugin_interface] implement wifi platform interface #3134
Conversation
String wifiName = await methodChannel.invokeMethod<String>('wifiName'); | ||
// as Android might return <unknown ssid>, uniforming result | ||
// our iOS implementation will return null | ||
if (wifiName == '<unknown ssid>') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be done in the Android implementation, to keep the platform interface platform-neutral.
(I know this is just copy paste, just commenting as I'm noticing it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved it
import '../wifi_info_flutter_platform_interface.dart'; | ||
|
||
/// Convert a String to a LocationAuthorizationStatus value. | ||
LocationAuthorizationStatus parseLocationAuthorizationStatus(String result) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we keep this out of the public API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file isn't exported so a user wouldn't have access to it unless they explicitly import it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But they can still import it no?
Why not move it to the file where it's used and prefix with _
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo making parseLocationAuthorizationStatus
private
LGTM
…On Mon, Oct 12, 2020 at 3:36 PM Maurice Parrish ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
packages/wifi_info_flutter/wifi_info_flutter_platform_interface/lib/src/method_channel_wifi_info_flutter.dart
<#3134 (comment)>:
> +import '../wifi_info_flutter_platform_interface.dart';
+import 'utils.dart';
+
+/// An implementation of [WifiInfoFlutterPlatform] that uses method channels.
+class MethodChannelWifiInfoFlutter extends WifiInfoFlutterPlatform {
+ /// The method channel used to interact with the native platform.
+ @VisibleForTesting
+ MethodChannel methodChannel =
+ MethodChannel('plugins.flutter.io/wifi_info_flutter');
+
+ @OverRide
+ Future<String> getWifiName() async {
+ String wifiName = await methodChannel.invokeMethod<String>('wifiName');
+ // as Android might return <unknown ssid>, uniforming result
+ // our iOS implementation will return null
+ if (wifiName == '<unknown ssid>') {
I moved it
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#3134 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAH2A5L2QGGI5KEN2SVLD63SKOAFPANCNFSM4SKUHDSQ>
.
|
* Android Code Inspection and Clean up (#3117) * [in_app_purchase] Android Code Inspection and Clean up (#3120) * Android Code Inspection and Clean up * Format * [video_player] Fix SSLProtocolException for low API version (#3122) * [camera] Set audio encoding bitrate when recording video (#3124) Fixes flutter/flutter#38787 * Fix links in package example readmes (#3130) http://flutter.io/ -> https://flutter.dev/ * [integration_test] Add watchPerformance (#3116) * add watchPerformance * [wifi_info_flutter] [wifi_info_flutter_platform_interface] Initial commit for `wifi_info_flutter` plugin and platform interface (#3129) * [video_player] fix Timer Leak (#3119) * [in_app_purchase] Add example test target to Podfile, add OCMock dependency (#3145) * Add linux directory to examples (#3064) When Linux support was added to these plugins, the app template wasn't yet stabilized, so was not checked in. Now that it is stable, this adds them so that the plugin_tools workaround that created them on each run can be removed. Other than CHANGELOG.md updates and updating the verison in pubspec.yaml, this is purely the result of running 'flutter create .' in the example/ folders and adding the resulting linux/ directories. * [wifi_info_flutter_plugin_interface] implement wifi platform interface (#3134) * [share] Replace deprecated Environment.getExternalStorageDirectory() call on Android. (#3152) * Android API 29 & 30 * Update Version * Update android sdk version to 29 for all mobile plugins. (#3042) * [google_sign_in] fix merge error in CHANGELOG (#3153) Co-authored-by: Hamdi Kahloun <32666446+hamdikahloun@users.noreply.github.com> Co-authored-by: Maurits van Beusekom <maurits@baseflow.com> Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com> Co-authored-by: Ming Lyu (CareF) <minglyu@google.com> Co-authored-by: Maurice Parrish <bmparr@google.com> Co-authored-by: creativecreatorormaybenot <creativecreatorormaybenot@gmail.com> Co-authored-by: Jenn Magder <magder@google.com> Co-authored-by: stuartmorgan <stuartmorgan@google.com> Co-authored-by: Chris Yang <ychris@google.com>
Description
Copy over wifi and location related methods for the wifi platform interface.
Related Issues
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?