Flutter desktop application development configuration and packaging Flutter Windows desktop software development
In the world of coders, the beautiful application experience comes from the programmer's handling of details and the realm of self-requirements. Young people are also busy coders. Every day and every week, they leave some footprints. It is the content of these creations, there is a kind of persistence, that is, I don't know why, if you are confused, you might as well take a look at the track of Code Farmer.
If you are interested, you can follow the public account biglead to get the latest learning materials.
- The series of articles from getting started to mastering Flutter is here
- Of course, the source code must also be here.
- github is a bit slow
- Series of learning tutorials here
Check out the Flutter SDK dependency branch
flutter channel
- 1
you can modify the branch
flutter channel master
- 1
Of course, I am using the beta version for internal testing. By default, Flutter does not enable desktop support, so we need to configure support
flutter config --enable-linux-desktop
flutter config --enable-macos-desktop
flutter config --enable-windows-desktop
- 1
- 2
- 3
Then we can take a look at the devices that Flutter can run on
flutter devices
- 1
Then we can create a Flutter project step by step through Android Studio.
The build tool corresponding to the desktop system will not be downloaded by default. Of course, when the program is run for the first time, the same build tool will be downloaded automatically. We may also actively build through commands.
flutter precache --macos
- 1
flutter precache --linux
- 1
flutter precache --windows
- 1
The directory structure of the built Flutter project is as follows.
Then we can run it. For example, if I run it on a MacBook, we only need to bring the parameters linux, macos, and windows to the corresponding operating system.
flutter run -d macos
- 1
Of course, you can also compile and package
flutter build macos
- 1
When you need to pay attention, if there is a network request, you need to add the network request permission application in DebugProfile.entitlements and Release.entitlements in the runner folder of the macos directory
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
- 1
- 2
- 3
- 4