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.
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.
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.
|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.|
In general Flutter widgets are classified into two categories,
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.
A Material Design app bar. An app bar consists of a toolbar and potentially other widgets, such as a TabBar and a FlexibleSpaceBar.
Layout a list of child widgets in the vertical direction.
A convenience widget that combines common painting, positioning, and sizing widgets.
A Material Design elevated button. A filled button whose material elevates when pressed.
The Flutter logo, in the widget form. This widget respects the IconTheme.
A Material Design icon.
A widget that displays an image.
A widget that draws a box that represents where other widgets will one day be added.
Layout a list of child widgets in the horizontal direction.
A run of text with a single style.
Also, read our article on medium to know about the popular animation widgets for creating an intuitive UI.
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.