Flutter on Desktop
Flutter provides support for compiling a native Windows, macOS, or Linux desktop app. Flutter’s desktop support also extends to plugins—you can install existing plugins that support the Windows, macOS, or Linux platforms.
Requirements
To compile a desktop application, you must build it on the targeted platform: build a Windows application on Windows, a macOS application on macOS, and a Linux application on Linux.
Additional macOS requirements
For macOS desktop development, you need the following in addition to the Flutter SDK:
- CocoaPods if you use plugins
Additional Windows requirements
For Windows desktop development, you need the following in addition to the Flutter SDK:
Visual Studio 2022 When installing Visual Studio, select the "Desktop development with C++" workload, including all of its default components, to install the necessary C++ toolchain and Windows SDK header files.Set up
On Windows, desktop support is enabled on Flutter 2.10 or higher. On macOS and Linux, desktop support is enabled on Flutter 3 or higher.
You might run a flutter Doctor to see if there are any unresolved issues. You should see a checkmark for each successfully configured area. It should look something like the following on Windows, with an entry for "develop for Windows":
Flutter enable specific platform
flutter config --enable-linux-desktop
flutter config --enable-macos-desktop
flutter config --enable-windows-desktop
Flutter disable specific platform
flutter config --no-enable-linux-desktop
flutter config --no-enable-macos-desktop
flutter config --no-enable-windows-desktop
Add desktop support to an existing Flutter app
After enable and restart Vscode run command in your root directory
$ flutter create --platforms=windows,macos,linux
How to change Icon of the app
Add icons_launcher: ^2.0.2
Add config to pubspec.yaml or create a separate icons_launcher.yamlicons_launcher:
image_path: 'assets/icon.png'
platforms:
android:
enable: true
ios:
enable: true
Run the package
flutter pub get
flutter pub run icons_launcher:create
You can change icons_launcher file name
Example :
Build a release app
flutter build windows
flutter build macos
flutter build linux

Comments
Post a Comment