Flutter Basics

Karan Gore
4 min readFeb 6, 2020

--

About Flutter

Flutter is an open-source mobile UI framework created by Google, this framework will help you to create android and IOS applications. Flutter is an SDK for building high-performance, high-fidelity apps for android and IOS and web from a single codebase. No mobile development experience is required to get started. Apps are written in Dart, which looks familiar if you’ve used a language like Java or JavaScript. Experience with object-oriented languages is helpful.

Some major components of the flutter are as follow:-

· Dart platform

· Flutter engine

· Foundation library

· Design-specific widgets

File Structure

flutter-app/
|- android
|- build
|- ios
|- lib
|- test

Android folder contains all the files required to build and configure an android app, people familiar with android development will recognize the files inside this directory such as gradle and manifest files.

Build folder contains the apk (Android Package Kit) files of our app we will get the debugging apk after we run our flutter project on an emulator or real device via USB debugging

Ios folder will contain all the files required to build and configure an IOS app, this folder ensures that the app we are being built we also have its own IOS version. People familiar with IOS development will recognize the files in ios directory

Lib is one of the important folders because all the files related to the development of the app should be created here, flutter provides us a main.dart file in which they provide an example regarding the UI and the working of the app which is pretty much helpful to understand the working. All the files required for the development (.dart files) are created in the lib directory.

Widgets in Flutter

Each and every component on our app is widget even if we want to display a single text on the screen flutter provides a Text widget for it. Everything in Flutter is a Widget, much like in JS frameworks you’re working with small reusable components. And a Widget is nothing more than a Dart class that extends a Flutter class. It all starts from main.dart as we discussed before we have a function void main which runs the class we want to run first after the app starts. The class which the main function runs is nothing but a simple class which extends a widget there are two widgets which our class mostly extends:-

1. StatelessWidget

2. StatefullWidget

These both are the predefined classes that will help us to use their properties. Widget build is a method which we override to create the screen with the help of other widgets the build method actually returns the widgets used in its body and also comes with a parameter of type BuildContext it is nothing but a reference to the location of a widget within the tree structure of all the widgets which are built inside the build methods body. Scaffold widget is responsible to display the screen of our app it is a class which has some properties such as:-

1. App Bar

2. Body

3. Floating Action

4. Bottom Navigation

5. Persistent Footer

These are some of the main properties of Scaffold which we will be using in the future while creating an app. Flutter widgets make it easy and quick to create an app.

Advantages

1. Same UI and business logic in all platforms. We know that basically any cross-platform framework provides a way to share codebase between the target platforms. But there are no such application frameworks that allow sharing both the UI code the UI itself besides Flutter.

2. Reduce code development time. Building a usual e-commerce app or any mid-size app in flutter doesn’t take much time, it may take hardly 1 week to complete it. Running our app on a virtual-device is also very easy with VS code and an android studio, not the configuration is required before running it on virtual-device.

3. Besides, the Flutter team has put lots of effort into providing a wide variety of ready-to-use widgets. Most of them are incredibly customizable, saving your time like no other framework before.

4. Custom, animated UI of any complexity available. One of the biggest advantages of Flutter is the ability to customize anything you see on the screen, regardless of how complex it may be.

5. If you have the same app for 2 platforms, it means less testing! The Quality Assurance process can be faster. Because of one codebase, the developers write automatic tests only once.

6. Google support for Flutter is impressive, and there are many helpful libraries with functionalities ready to be implemented.

LinkedIn Article: https://www.linkedin.com/pulse/flutter-basics-karan-gore

To know more about us and our work do visit Exaltare Technologies Pvt Ltd and also our LinkedIn account

--

--