Skip to content

Remove dart:io from location_platform_interface for Wasm scoring - #1117

Open
mauriziopinotti wants to merge 1 commit into
Lyokone:masterfrom
mauriziopinotti:fix/location-platform-interface-wasm
Open

mauriziopinotti wants to merge 1 commit into
Lyokone:masterfrom
mauriziopinotti:fix/location-platform-interface-wasm

Conversation

@mauriziopinotti

Copy link
Copy Markdown

Downstream Flutter packages that import location can build successfully with flutter build web --wasm and still lose pub points. For example, easy_place_picker_plus's score report traces an unconditional dart:io import through location_platform_interface. This is a static-analysis finding. The example's Wasm build succeeds with the published dependency.

The interface only uses dart:io to check whether changeNotificationOptions is running on Android. Use Flutter's defaultTargetPlatform and guard with kIsWeb so the Android method channel is still skipped in browsers running on Android. Removing the import eliminates the reported path to dart:io.

Verified with flutter analyze and flutter test in packages/location_platform_interface (39 tests passed).

This branch has not been deployed

No deployments
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