Skip to content

network_info_plus_watchos 0.1.1: upstream's example, its location request answered - #41

Open
iamoguzhanarslantas wants to merge 1 commit into
flutterwatch:mainfrom
iamoguzhanarslantas:network-info-plus-watchos-permission-handler
Open

iamoguzhanarslantas wants to merge 1 commit into
flutterwatch:mainfrom
iamoguzhanarslantas:network-info-plus-watchos-permission-handler

Conversation

@iamoguzhanarslantas

Copy link
Copy Markdown
Contributor

Summary

The follow-up announced in #11. network_info_plus_watchos's example asks permission_handler for location at start, behind Platform.isIOS, which is true on the watch. Until now the example guarded that call with FlutterWatchosPlatform.isIos, because permission_handler had no watchOS implementation. Now that permission_handler_watchos is in this repository, the request has an answer, so the example is upstream's again (AUTHORING.md §3).

Not verified on a physical Apple Watch. Everything below was checked on the watchOS 27.0 Simulator and on the host.

  • example/lib/main.dart is network_info_plus 8.2.2's own example, unchanged.
  • example/pubspec.yaml adds permission_handler_watchos by path, in place of flutter_watchos. It names permission_handler: ^13.0.2, as upstream's example does.
  • example/watchos/Runner/Info.plist has upstream's NSLocationWhenInUseUsageDescription ("Obtain WIFI Name"). With the next flutter-watchos release, this key alone compiles in permission_handler_watchos's location group (permission_handler_watchos: compile in only the permission groups an app uses #39).
  • The runner installs FlutterWatchOSAppDelegate, as the current flutter-watchos create template does. Without it, the CLI warned that permission_handler_watchos's notification group needs it.
  • watchos_example_start_test.dart checks a start without an error, then the network info. The network info waits for the location prompt, so:
    • with location already answered (the Simulator keeps the answer across installs), it checks the network info at once;
    • on a fresh install with no one to answer, it skips that part instead of hanging;
    • with --dart-define=NIP_PROMPT=true, it waits up to a minute for someone to answer.
  • The package README's "Example deviations", PORTING_REPORT, the content-scale test's comment and the root README follow. The root README no longer lists this example among those that start with an error.
  • 0.1.1, with a CHANGELOG entry: the example files are part of the package.

Verified

On the watchOS 27.0 Simulator (Apple Watch Series 12, 46 mm), run with flutter.inspector.structuredErrors=false:

  • No exception and no overflow in the first 15 seconds.
  • The location prompt shows upstream's text, and once location is allowed the example shows its network info.
  • Upstream's network_info_plus_test.dart passes.
  • The start test passes with location answered before, and with the prompt answered during the run. On a fresh install with no one to answer, it skips its second part.

On the host:

  • The 7 example widget tests pass, including the content-scale overflow check on every watch size.
  • The package's 4 host tests pass.
  • Every tool/ check, dart format as CI runs it, pub publish --dry-run and tool/check_native_sources.sh (Xcode 27.1) are clean.

Not verified

  • A physical Apple Watch.
  • Xcode 26: only Xcode 27.1 is installed here. The native job covers it, and this change touches no native plugin source.

Notes for review

🤖 Generated with Claude Code

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant