In this series of Flutter we will see Flutter-dart programming introduction. Flutter was created by Google in 2011. Flutter is an open-source, general-purpose, object-oriented programming language, whose syntax is almost similar to C. The main purpose of Dart programming is used to create frontend user interface for web and mobile.
Dart also like other programming language supports almost all the main concepts like – classes, interfaces, functions etc. Dart does not support programming language arrays directly. It supports collections, which are used to replicate data structures such as arrays, generics, and other optional typing.
Introduction of Flutter Architecture
Flutter Architecture is mainly made up of four components –
- Flutter Engine
- Foundation Library
- Design specific widgets
Flutter Engine :
Flutter engine is a portable runtime for high-quality mobile applications, mainly based on c++. It implements the core libraries of flutter which include Animation and Graphics, File and Network I/O, Accessibility Support, Plugin Architecture and Dart Runtime to develop, compile and run flutter application. It uses Google's Skia, the open-source graphic-library, to render low-level graphics.
Foundation Library :
Foundation Library holds all the necessary packages to write any flutter application, which is written in the dart programming language.
Widget is the main concept of this framework, everything is Widget in any flutter application. Widgets are user interface components that are used to create the user interface of the application. Widgets in Flutter are similar to React components.
In Flutter, the application itself is a widget that holds many sub-widgets. This means that the application is a top-level widget, and its UI is made up of one or more children widgets, which then have many sub-widgets inside themselves.
Design specific widgets :
The Flutter framework has two sets of widgets that follow specific design rules, namely Material Design for Android applications and Cupertino style for iOS applications.
This is also a Widget which provides interaction using GestureDetector in flutter application. GestureDetector is an invisible widget that has the ability to capture user interaction such as tapping or dragging or scaling on its child widget. Many of Flutter's native widgets support interaction using GestureDetector.
State Management :
Flutter Widget manages its state using a special widget StateFulWidget. Whenever its initial state changes, it gets auto re-rendered. State management in Flutter is like React. For which StateFulWidget is used.