32.1 Flutter App Creation

To begin a new app simply create a folder of the name that you want to use for the app, and then ask flutter to create the app skeleton.

mkdir button
cd button
flutter create .

A skeleton and fully functional dart program is found in lib/main.dart. The file pubspec.yaml holds general information about the app (name, description, publish_to, and version), the development environment, dependencies (including dev_dependencies required just for development), and Flutter configurations.

If your Android device is connected to the computer then you can build, install, and run the app on the device with run:

$ flutter run

Check what devices are available with:

$ flutter devices

To build and run the app on the linux device (-d or --device-id):

flutter run -d linux

If you see a Exception: No Linux desktop project configured. then the following should assist:

$ flutter create --platforms=windows,macos,linux .

See https://flutter.dev/desktop#add-desktop-support-to-an-existing-flutter-app for details.

Your donation will support ongoing availability and give you access to the PDF version of the book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2021 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0.