Repository navigation
feat(dart): add opt-in WinUI 3 backend support to cnativeapi build hook (#63) - #70
Merged
Merged
Conversation
lijy91
force-pushed
the
feat/issue-63
branch
2 times, most recently
from
December 1, 2026 02:20
eeee17f to
4898b78
Compare
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
Closes #63.
Adds an opt-in
hooks.user_defines.cnativeapi.winui3boolean flag (falseby default) tobindings/dart/cnativeapi/hook/build.dartso Dart and Flutter apps on Windows can enablenativeapi-core's WinUI 3 backend (ContentDialogmessage dialogs,MenuFlyoutmenus, WinUI 3 views,AppWindowtitle-bar colors, andAppNotifications):When enabled on Windows (
OS.windows):outputDirectorySharedviacmake/RestoreWinUI3.ps1(guarded by a stamp matchingRestoreWinUI3.ps1and tracked inoutput.dependencies).cppwinrt.exe(mirroringcore/cmake/WinUI3.cmake).*_winui3_windows.cpp) instead ofmessage_dialog_windows.cppunder/std:c++20(so C++/WinRT uses standard<coroutine>on MSVC 14.52+) withNATIVEAPI_ENABLE_WINUI3,NOMINMAX,/MP, and/bigobj, and linkswindowsapp.Microsoft.WindowsAppRuntime.Bootstrap.dll(x64/arm64/x86) as aCodeAsset.Default builds (
winui3: falseor omitted) and non-Windows builds remain unchanged.Verification
winui3option validation inbindings/dart/cnativeapi/test/build_hook_test.dart.cnativeapi.dllwithwinui3: true, verifyingMicrosoft.WindowsAppRuntime.Bootstrap.dllbundling, and loadingcnativeapi.dllviadart:ffito confirmnative_message_dialog_is_extended_supported(),native_notification_manager_is_supported(),native_menu_is_backend_supported(WINUI3), andnative_view_is_backend_supported(WINUI3)all reporttrue.bindings/dart/cnativeapi/README.md.