« Previous 1 2 3 4
Program from one source to many apps with Flutter
Big Flap
Cross-Platform
If you want to compile the app you created for the desktop, entering three commands at the command line in the project's root directory is all it takes:
$ flutter config --enable-linux-desktop ### Important: Do not forget the ### dot at the end of this command $ flutter create --platforms=linux . $ flutter build linux
As a result, you get an executable binary in the build/linux/x64/release/bundle/
folder. For Windows or macOS as the target platform, just replace the linux
tag with windows
or macos
. Compiling for Windows and macOS only works on the respective operating systems. For more information regarding desktop support, see the Flutter website [9].
Conclusions
This article only provides a rough overview of Flutter, but once you understand the strategy of how apps are built, you can program apps for a wide variety of platforms relatively easily and conveniently. The Flutter repository [2] also proves to be a veritable treasure trove of packages that make everyday programming far easier. The weather app, for example, could be extended with the geolocator
[10] package to determine the current location and display the local weather without having to specify the location explicitly.
Infos
- Flutter: https://flutter.dev
- Package repository: https://pub.dev
- Installation guide: https://flutter.dev/docs/get-started/install/linux
- Android Studio: https://developer.android.com/studio
- Material Design: https://material.io/design/introduction
- Weather package: https://pub.dev/packages/weather
- Shared preferences: https://pub.dev/packages/shared_preferences
- Android Emulator: https://developer.android.com/studio/run/emulator
- Desktop support: https://flutter.dev/desktop
- Geolocator package: https://pub.dev/packages/geolocator
« Previous 1 2 3 4
Buy this article as PDF
(incl. VAT)
Buy ADMIN Magazine
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Most Popular
Support Our Work
ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.