FLUTTER
Creating Flutter apps
David Bolton shows how to set up a Flutter development environment on Linux and then how to build a simple calculator in Flutter.
Credit: https://flutterawesome.com/calculator-create-with-flutter/
OUR EXPERT
David Bolton has been programming Flutter apps for a couple of years but this is the first time he’s done Flutter development on Linux.
QUCK TIP
The Flutter plugin includes tools for inserting widgets into existing widgets. This is far quicker than typing and trying to balance brackets. Rightclick on a widget and click Show Context Actions.
If you’ve heard of Flutter, you probably know it as a cross-platform toolkit for writing mobile I apps – and you’d be correct. But that crossplatform ability was extended last year to include developing for Linux desktop alongside use for singlepage web apps.
If Flutter is a toolkit, what language do you use to program it? It’s called Dart. It’s a modern programming language and you can also write programs purely in Dart. If you’re looking for a programming language that’s more advanced than C and includes objects and decent string handling, but is nowhere as complex as C++, Dart falls in the middle. This isn’t a tutorial on Dart but the code should be easy enough to understand. If you want to find out more, visit the official website at https://dart.dev. You’ll find an online editor that you can experiment with and run Dart programs.
It’s a way of building up the user interface of an application through the use of widgets. A widget is a component containing the logic, interaction and design of a UI element. It’s implemented as a class in Dart and you can find out more at https://flutter.dev.
Flutter apps are different from other types of applications. A Flutter app has all its widgets redrawn many times per second; as much as 60 frames per second or faster on fast hardware. This makes it suitable for games programming. Even the single-page web apps are rebuilt many times per second.
Platform support
Originally created for Android and iOS, it now includes web, Windows, Mac and Linux. For Linux, you need to be on Ubuntu 18.04 LTS or higher, or Debian 10, 11 and possibly 12. However, it is for 64-bit development only.
Let’s look at getting set up for Flutter development on Ubuntu. You can use Android Studio, VS Code or a few others. After installing an editor, you must install a Flutter plugin. That should also install a Dart plugin. To install VS Code on Ubuntu using Snap, type the following at the command line: