Flutter apps are becoming increasingly common with UI developers because of their ability to allow code reuse across multiple platforms like Android and iOS. This article aims to explain how you can create your first Flutter app with ease and join the UI developers’ army using Flutter for their day to day UI development needs.
What is Flutter?
Flutter is a massively popular, cross-platform, UI toolkit designed for creating natively compiled web, desktop, and mobile applications using a single codebase. Developed by Google, Flutter’s coding ease, cross-platform usability, and the ability to build from a single codebase are making it increasingly popular with developers. It already supports Android and iOS, while the Flutter web app is in beta version. The macOS and Linux support for Flutter is still in the development stage.
Flutter vs. React Native
Choosing between Flutter framework and React Native in 2020 boils down to the following debate points:
1. Learning curve
2. Extra functionalities
React Native is inherently pretty basic and lacks the extra styling functionalities offered by Flutter. Everything is a widget with Flutter, and these widgets are easily customizable and adaptive across both Android and iOS.
Also Read: React Native vs Flutter- Which is Better?
How to create your first app with Flutter Tutorial?
Creating a flutter web app or a mobile app is a pretty straightforward process that comprises the following steps:
Using Google Flutter for app development requires you to have Android Studio installed on your computer and some experience in working with it.
Method 1: Installing Flutter with snapd
You can use snapd to install Flutter on Ubuntu or similar distributions.
1. Enter the following on your terminal:
sudo snap install flutter –classic
sudo snap install flutter –classic flutter 0+git.142868f from flutter Team/ installed
2. Launch Flutter using the command:
The Flutter framework now downloads to your computer and is initialized.
Method 2: Installing Flutter manually
If you are not using the Ubuntu distribution, or if you do not have snapd, you can download the required version of Flutter manually.
1. Download the required version of Flutter from this link.
2. Open the .bashrc file in your home directory using the command below:
gedit ~/.bashrc &
3. Add the following to the end of the file:
4. Save and close the file. If you extract Flutter somewhere other than the home directory, the Flutter SDK path will be different.
5. Close your terminal and open it again to reload your configuration. As an alternative, the configuration can be sourced using the command below:
Checking the Installation
To check if the installation is successful, run the following command:
flutter doctor -v
You can see the information about installed components using this command.
Installing IDE plugins
Install plugins in your chosen integrated development environment (IDE) to interface with Flutter SDK. Flutter can be used with IDEs like Android Studio, IntelliJ IDEA (Community Edition), and VS Code. This tutorial uses Android Studio as an example.
- Launch Android Studio.
- Navigate to Settings >> Plugins >> Marketplace.
- Enter Flutter in the search field. Click Install.
- Click Agree when you see an option to install the Dart plugin. If the option does not appear on the screen, install it by repeating the steps mentioned above.
- Check if all the required plugins are installed by rerunning the flutter doctor -v command in the terminal.
Creating your own Flutter App
- Navigate to New >> New Flutter project in your Android Studio IDE.
- Select Flutter Application in the Window that appears next.
- Name your project hello_world. You might also have to specify the path to the SDK.
- Enter the package name.
You have now created a Flutter project. Launch it on a device or use an emulator. To run your basic Flutter app on an Android emulator, follow the below-mentioned steps:
- Enable VM acceleration on your device.
- Launch Android Studio, and navigate to AVD Manager >> Create VirtualDevice.
- Select a device definition and select Next.
- Select the system image for the Android version you want to emulate (x86 or x86_64 is recommended). Click Next.
- Select Hardware – GLES 2.0 under Emulated Performance.
- Verify if the AVD configuration is correct. Select Finish.
- Click Run in the Android Virtual Device Manager. The default canvas of your selected OS version and device appears on the screen.
The Faster Way with Example
You have successfully created your very first Flutter app. However, the process mentioned above is a fairly time-consuming one. There is a faster way how you can structure Flutter apps and use the Flutter framework. And here we are talking about Flutter templates. Check out this beautiful example:
Argon PRO Flutter allows you to create powerful mobile applications with ease. The usual Flutter components have been redesigned to make them easy to use and minimalistic, to save you the trouble of having to redesign the Flutter framework for your needs. The features of Argon PRO Flutter templates are:
- Fully coded components like inputs, cards, buttons, and navigations.
- All components can take variations in colour, which you can easily modify inside our theme file.
- The ability to match together different widgets to put together a mobile app with ease.
- The ability to jump-start development using onboarding screens, discover screens, or profile screens to quickly set up a basic Flutter mobile project.
If you want to give it a try, check out the free version on Creative Tim’s website.
Flutter is a cool, easy, cross-platform solution to your web and mobile development needs. Because of its versatility and speed, it is here to stay. Creative Tim offers multiple Argon PRO Flutter app examples for you to choose from. If you want to make designing Flutter apps a walk in the park, try the cool Flutter templates by Creative Tim today!