Fix warnings and improve compatibility in plugin#1518
Open
Kataglyphis wants to merge 8 commits intoBaseflow:mainfrom
Open
Fix warnings and improve compatibility in plugin#1518Kataglyphis wants to merge 8 commits intoBaseflow:mainfrom
Kataglyphis wants to merge 8 commits intoBaseflow:mainfrom
Conversation
Removed unused [this] capture in lambda to fix warnings and wrapped the result map in EncodableValue for compatibility.
Added clang-cl support and updated type conversion for request results.
Updated the Windows permission handler for clang-cl compatibility.
There was a problem hiding this comment.
Pull request overview
This PR improves compatibility with clang-cl (LLVM) compiler for the Windows permission handler plugin by making implicit type conversions explicit and cleaning up compiler warnings. The changes ensure the plugin builds successfully with both clang-cl and MSVC.
Changes:
- Made
EncodableValuetype conversion explicit when passingEncodableMaptoresult->Success() - Removed unused
[this]lambda capture that caused warnings in clang-cl - Updated version numbers for both
permission_handler_windows(0.2.1 → 0.2.2) andpermission_handler(12.0.1 → 12.0.2)
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| permission_handler_windows/windows/permission_handler_windows_plugin.cpp | Explicit EncodableValue conversion and removed unused lambda capture |
| permission_handler_windows/pubspec.yaml | Version bump to 0.2.2 |
| permission_handler_windows/CHANGELOG.md | Added changelog entry for clang-cl support |
| permission_handler/pubspec.yaml | Version bump to 12.0.2 and updated Windows dependency |
| permission_handler/CHANGELOG.md | Added changelog entry for Windows compatibility update |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ## 0.2.2 | ||
|
|
||
| * clang-cl support | ||
| * Explicit Type Conversion: Wrapped `requestResults` in `flutter::EncodableValue(...)` before passing it to `result->Success() |
There was a problem hiding this comment.
Missing closing backtick after result->Success(). The line should end with a closing backtick to properly format the inline code.
Suggested change
| * Explicit Type Conversion: Wrapped `requestResults` in `flutter::EncodableValue(...)` before passing it to `result->Success() | |
| * Explicit Type Conversion: Wrapped `requestResults` in `flutter::EncodableValue(...)` before passing it to `result->Success()` |
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.
explicit EncodableValue in Windows
New clang-cl versions are strict about return types.
This fix creates support for modern clang-cl compilation (explicit EncodableValue & cleanups)MSVC has lazier rules about that.
PR Body
Description
This PR addresses compilation errors when building the Windows plugin using
clang-cl(LLVM).While MSVC is permissive regarding implicit template conversions,
clang-clis stricter and fails to compile theSuccesscall when passing astd::mapdirectly. This change makes the type conversion explicit, which satisfies Clang while remaining fully compatible with MSVC.Changes
requestResultsinflutter::EncodableValue(...)before passing it toresult->Success().no matching member function for call to 'Success'[this]capture in thegeolocatorlambda.[clang] lambda capture 'this' is not used [-Wunused-lambda-capture]Testing
clang-cl(LLVM).requestPermissionsstill returns correct results on Windows.Related Issue
clang-clfor Windows builds (e.g. for faster builds).Pre-launch Checklist
You can have a look here where my project
builds correctly with the fix.
pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is does not need version changes.CHANGELOG.mdto add a description of the change.///).main.dart format .and committed any changes.flutter analyzeand fixed any errors.