Repository navigation
network_info_plus_watchos 0.1.1: upstream's example, its location request answered - #41
Open
iamoguzhanarslantas wants to merge 1 commit into
Conversation
…uest answered The follow-up flutterwatch#11 announced. Upstream's example asks permission_handler for location at start, behind Platform.isIOS, which is true on the watch. With permission_handler_watchos in this repository that request has an answer, so the FlutterWatchosPlatform.isIos guard, a watch deviation AUTHORING §3 allows only while the plugin has no watchOS implementation, is gone: * example/lib/main.dart is network_info_plus 8.2.2's own, unchanged. * example/pubspec.yaml adds permission_handler_watchos (by path; it is staged, not yet on pub.dev) in place of flutter_watchos, and names permission_handler ^13.0.2, as upstream's example does. * The Info.plist has upstream's NSLocationWhenInUseUsageDescription, "Obtain WIFI Name", which the prompt shows and which, with the next flutter-watchos release, compiles in permission_handler_watchos's location group alone. * The runner installs FlutterWatchOSAppDelegate, as the current `flutter-watchos create` template does; the CLI warned that permission_handler_watchos's notification group needs it. * The start test checks a start without an error, then the network info, which waits for the location prompt: it is skipped on a fresh install with no one to answer, unless the run passes --dart-define=NIP_PROMPT=true, and runs at once when location was answered before. * README's "Example deviations", PORTING_REPORT, the content-scale test's comment and the root README (the example no longer starts with an error) follow. Checked on the watchOS 27.0 Simulator (Apple Watch Series 12, 46 mm): no exception and no overflow in the first 15 seconds, the location prompt with upstream's text, the network info once allowed; upstream's network_info_plus_test.dart; the start test with location answered before (passed), answered during the run (passed) and unanswered (skipped); the 7 widget tests, the content-scale check on every watch size included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The follow-up announced in #11.
network_info_plus_watchos's example askspermission_handlerfor location at start, behindPlatform.isIOS, which is true on the watch. Until now the example guarded that call withFlutterWatchosPlatform.isIos, becausepermission_handlerhad no watchOS implementation. Now thatpermission_handler_watchosis in this repository, the request has an answer, so the example is upstream's again (AUTHORING.md §3).example/lib/main.dartis network_info_plus 8.2.2's own example, unchanged.example/pubspec.yamladdspermission_handler_watchosby path, in place offlutter_watchos. It namespermission_handler: ^13.0.2, as upstream's example does.example/watchos/Runner/Info.plisthas upstream'sNSLocationWhenInUseUsageDescription("Obtain WIFI Name"). With the next flutter-watchos release, this key alone compiles inpermission_handler_watchos's location group (permission_handler_watchos: compile in only the permission groups an app uses #39).FlutterWatchOSAppDelegate, as the currentflutter-watchos createtemplate does. Without it, the CLI warned thatpermission_handler_watchos's notification group needs it.watchos_example_start_test.dartchecks a start without an error, then the network info. The network info waits for the location prompt, so:--dart-define=NIP_PROMPT=true, it waits up to a minute for someone to answer.Verified
On the watchOS 27.0 Simulator (Apple Watch Series 12, 46 mm), run with
flutter.inspector.structuredErrors=false:network_info_plus_test.dartpasses.On the host:
tool/check,dart formatas CI runs it,pub publish --dry-runandtool/check_native_sources.sh(Xcode 27.1) are clean.Not verified
Notes for review
permission_handler_watchosis staged at 0.0.1 and not on pub.dev yet, so the example depends on it by path. The published 0.1.1 would carry an example whose permission package someone outside this repository cannot fetch yet. If you'd rather keep the guard untilpermission_handler_watchosis published (permission_handler_watchos: App Review proof and compile-time opt-in before 0.1.0 #19), this can wait until then.🤖 Generated with Claude Code