Migrate a Windows project to support dark title bars
Projects created before Flutter 3.7 have light title bars even when the Windows theme is dark mode. Projects created before Flutter 3.7 need to be migrated to support dark title bars.
Migration steps
#Your project can be updated using these steps:
- Verify you are on Flutter version 3.7 or newer using
flutter --version
- If needed, use
flutter upgrade
to update to the latest version of the Flutter SDK - Backup your project, possibly using git or some other version control system
- Delete the following files:
windows/runner/CMakeLists.txt
windows/runner/win32_window.cpp
windows/runner/win32_window.h
- Run
flutter create --platforms=windows .
- Review the changes to the following files:
windows/runner/CMakeLists.txt
windows/runner/win32_window.cpp
windows/runner/win32_window.h
- Verify your app builds using
flutter build windows
Example
#除非另有说明,本文档之所提及适用于 Flutter 的最新稳定版本,本页面最后更新时间: 2024-04-04。 查看文档源码 或者 为本页面内容提出建议。