Skip to content

Fix warnings and improve compatibility in plugin#1518

Open
Kataglyphis wants to merge 8 commits intoBaseflow:mainfrom
Kataglyphis:main
Open

Fix warnings and improve compatibility in plugin#1518
Kataglyphis wants to merge 8 commits intoBaseflow:mainfrom
Kataglyphis:main

Conversation

@Kataglyphis
Copy link

@Kataglyphis Kataglyphis commented Feb 13, 2026

explicit EncodableValue in Windows

NOTE:
Right now pipline is not running through because I changed the version number
Anything I shoukld do about it ?

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-cl is stricter and fails to compile the Success call when passing a std::map directly. This change makes the type conversion explicit, which satisfies Clang while remaining fully compatible with MSVC.

Changes

  1. Explicit Type Conversion: Wrapped requestResults in flutter::EncodableValue(...) before passing it to result->Success().
  • Error fixed: no matching member function for call to 'Success'
  1. Warning Cleanup: Removed an unused [this] capture in the geolocator lambda.
  • Warning fixed: [clang] lambda capture 'this' is not used [-Wunused-lambda-capture]

Testing

  • Compiles successfully with clang-cl (LLVM).
  • Compiles successfully with MSVC (standard Visual Studio compiler).
  • Verified requestPermissions still returns correct results on Windows.

Related Issue

  • Fixes build issues for users utilizing clang-cl for Windows builds (e.g. for faster builds).

Pre-launch Checklist

  • I made sure the project builds.
    You can have a look here where my project
    builds correctly with the fix.
  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is does not need version changes.
  • I updated CHANGELOG.md to add a description of the change.
  • I updated/added relevant documentation (doc comments with ///).
  • I rebased onto main.
  • I added new tests to check the change I am making, or this PR does not need tests.
  • I made sure all existing and new tests are passing.
  • I ran dart format . and committed any changes.
  • I ran flutter analyze and fixed any errors.

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.
@Kataglyphis Kataglyphis marked this pull request as ready for review February 13, 2026 14:57
Copilot AI review requested due to automatic review settings February 13, 2026 14:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 EncodableValue type conversion explicit when passing EncodableMap to result->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) and permission_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()
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()`

Copilot uses AI. Check for mistakes.
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.

2 participants