Flutter Widgets Cheatsheet: Categories, Types and Basic Widgets
DhiWise
March 3, 2023
Author
DhiWise
{
March 3, 2023
}
Flutter is Google’s UI toolkit for crafting beautiful, natively compiled iOS and Android apps using a single code base. The Flutter app is designed using widgets – These are the basic building blocks of every Flutter application. Widgets describe what the app UI should look like given its current configuration and state.
There are multiple Flutter widgets, the articles give you a quick look into the basic Flutter widgets, types, and categories.
Flutter has become a star in the eyes of Android and iOS developers by empowering them to build cross-platform apps using a single codebase. The technology seems to be successfully overcoming the three big challenges in app development.
There is no need to have separate teams for Android and iOS development, just hire one team and implement the cross-platform development functionality of Flutter.
Improves productivity and speeds up development with Dart’s “Just in Time” and “Ahead of Time” compilation. And thus it helps to reduce the development cost to half.
Unlike other cross-platform options, Flutter makes the app more beautiful, stable, and consistent.
All that brings much relief for the developer's community as they now have more time for creative things in app development.
Well, now we know how useful Flutter is for smoothly building beautiful cross-platform apps. Let's know about the basic building blocks of the Flutter application known as Flutter widgets.
Flutter Widgets:
Each element on the Flutter UI is a widget such as text, container, image, button, animations, and motions. So, the view of a screen completely depends on the choice and the sequence of the Flutter widgets used in building the application. Therefore the structure formed by the application code is called a tree of widgets.
These widgets can be classified into the following fourteen categories according to the functionality they provide in the Flutter application.
Category
Description
Accessibility
Makes the app more accessible.
Animation and motions
Add animation to the widgets.
Assets image and icon
Manage assets, display images, and show icons.
Async
Provides async functionality to the Flutter application.
Basics
Essential widgets for the Flutter application development.
Cupertino
Beautiful and high-fidelity widgets for iOS styling.
Input
Take user input in addition to input widgets in Material Components and Cupertino.
Interaction Models
Respond to touch events and route users to different views.
Layout
Arranges other widgets, columns, rows, grids, and other layouts.
Material Components
Visual, behavioral, and motion-rich widgets that follow material design guidelines.
Painting and Effects
Set of widgets that add visual changes to their child widgets without changing their layout and
shape.
Scrolling
Scrolls multiple widgets as the children of the parents.
Styling
It deals with the theme, responsiveness, and sizing of the app.
Text
It displays and styles text.
Flutter Widget types
In general Flutter widgets are classified into two categories,
Stateless Widget
Stateful Widget
However, you can find more classes in the hierarchy of Flutter sources.
StatelessWidget: The widget does not require a mutable state.
StatefulWidget: The widget has a mutable state i.e state information can be read synchronously when it is built and it may change during the widget's lifetime. Therefore it's essential to ensure that the state is promptly notified when the change occurs using setState.
ProxyWidget: The Widget has a child widget provided to it, instead of building a new widget. It is useful as a base class for other widgets like InheritedWidget and ParentDataWidget.
RenderObjectWidget: It provides the configuration for the RenderObjectElements, which wrap RenderObjects, that provide the actual rendering of the application.
InheritedWidget: It is a base class for widgets that efficiently propagates information down the tree. To obtain the near instance of a particular type of inherited widget from a build context, use BuildContext.dependOnInheritedWidgetOfExactType.
When referenced in this way, it causes the consumer to rebuild when the inherited widget itself changes state.
ParentDataWidget: It is a base class for a widget that hooks ParentData information to children of RenderObjectWidgets. It is used to provide a per-child configuration for RenderObjectWidgets with more than one child.
LeafRenderObjectWidget: It is a superclass for RenderObjectWidgets that configure RenderObject subclasses that have no children.
SingleChildRenderObjectWidget: It is a superclass for RenderObjectWidgets that configure RenderObject subclasses that have a single child slot.
MultiChildRenderObjetWidget: It is a superclass for RenderObjectWidgets that configure RenderObject subclasses that have a single list of children.
_NullWidget: Zero cost widget. Use it when you need a placeholder.
Most commonly used Flutter Widgets with the example
1. Appbar
A Material Design app bar. An app bar consists of a toolbar and potentially other widgets, such as a TabBar and a FlexibleSpaceBar.
Also, read our article on medium to know about the popular animation widgets for creating an intuitive UI.
Summing up:
And here you have it; everything about the Flutter widgets!! Hope you find it useful to get a quick view of Flutter's basic widgets, categories, and types.
Well, if you are looking for a way to make your app development faster without affecting code quality try DhiWise- A ProCode app development platform for web and mobile application development.
Its Flutter app builder provides you with the state of the art features, such as Figma to flutter, state management, flexibility to customization, team collaboration, complete code ownership, and more.
So, don’t waste your precious time on repetitive tasks in app development, sign up now to generate your production code in just a few steps.