Top 11 Flutter Widgets To Know In 2021

  Rakesh Sharma    October 12, 2021    469

 

These days, flutter is one of the most popular framework for developing mobile, web and desktop applications. It is full of widgets and it makes it more sustainable. Flutter widgets are used for developing high-quality cross platform applications because they are customizable and offer extensive flexibility & fluidity that can be the best fit for any mobile app type. Widget elements are organized in the form of a widget tree. The manner in which the widgets are placed defines the operation of the front-end of the native applications screen. The two primary things of Flutter widgets are the configuration and the widget state. There are lots of Flutter widgets available and here we’ll discuss the top 11 widgets for developing flutter apps. Before digging into the flutter widget list, let us see the  types of flutter widgets.

You can also know- Amazing New Features Of Flutter 2.0

Types Of Flutter Widgets-

There are two types of Widgets in Flutter- Stateless widget and Stateful widget. Based on the two types, these widgets are further categorized into 14 different categories as- Async, Accessibility, Assets, Images and Icons, Layout, Interaction Models, Material components, Animation and motion, Painting and effects, styling, text.

Top 11 Flutter Widgets-

1. SafeArea-

This widget is best to use for developing dynamic and adaptive UI. It helps to adjust the screen with various devices of different width and height. Also, it helps in overcoming the area constraints induced by status bar, notches, navigation bar etc. It’s implementation doesn’t allow the design to overlay any of the areas where there is frontend UI visibility constraint and so makes it error-free. Hence SafeArea widget is also known as padding widget that adds padding to android or iOS apps wherever there is a constraint. SafeArea widget will also indent the child with the necessary padding necessity, particularly for the devices with the Notch like iPhone X.

2. ConstrainedBox-

It is a built-in widget available in Flutter SDK. Generally it is used to add size limitations to the child widgets. It allows developers to add flexibility with respect to height and width in a child widget. But the widget has limitation when the child is bigger in size than the container. It cuts the child’s view, making the front end look somewhat out of the line. This issue can be tackled by not defining the maxHeight property and adjusting it to by default value of double.infinity. Example of this widget is- 

if you wanted child to have a minimum height of 50.0 logical pixels, you could use const BoxConstraints(minHeight: 50.0) as the constraints.

3. Align Widget-

You should organize components inside the UI. Flutter can compose these widgets together. But how do we position a child under a parent widget? We can use the Align widget. For instance, how we choose the position of the text inside a container. Following code shows you the result.

child: Container(
 height: 120.0,
 width: 120.0,
 color: Colors.blue[50],
 child: Align(
   alignment: Alignment.center,
   child: Text(
     "Geno Tech",
     style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
   ),
 ),
)

4. Layout Builder-

This widget is used to determine the size of the widget and how it depends on the parent widgets(height and width properties). Its builder function contains parameters to build the context and the incoming box constraints. Within methods, we check the constraints and get a decision. The syntax is-

LayoutBuilder(
 builder: (BuildContext context, BoxConstraints constraints) {
   return Widget();
 }
)

5. FittedBox-

It is a responsive Flutter widget that helps to induce responsiveness into the single child assigned to it. You have to add a Row widget as a child in this FittedBox widgets. Row widget has two containers as its children. In this case, the second child will overflow to one side but, this issue is solved with the FittedBox widget. 

FittedBox widget is used to scale and position the child widget inside the parent widget. UI developed with this widget is claen, and dynamic. One can use the FittedBox class and enter a child widget while using the FittedBox widget.

6. StreamBuilder-

It is used to synchronize the streams of received data. This widget is supported by Dart language that extends support to asynchronous streams of data. StreamBuilder widget takes in two arguments- A Stream and A Builder. Widget acts as a pipe which receives an entered data from one end and releases it at the other end. Also, registered listeners can be in multiple numbers.

7. FloatingActionbutton-

Every flutter developer uses FloatingActionButton for app development.  Basically it is a hovering button used to draw attention to a particular element of app content. FloatingActionBubtton is a main widget of Scaffold widget.

8. Tooltip-

In the app, to express details visually we use icons. But in some of the cases, users realize the meaning of the icon. At that time we display text label when tapping or long-press on the icon. This is a use of Tooltip widget.

child: Tooltip(
   message: 'Setting',
   child: FlatButton(
     onPressed: () {  },
     child: Icon(
       Icons.settings,
       size: 100,
     ),
   )
),

9. Hero-

Whenever you need to click on an item and route to the next page which relevant to the clicked item, you can use the Herp widget with good animation between the transition. With this, you can provide a great UI experience to your users.

10. Wrap-

Wrap Widget of Flutter is used to wrap child in horizontal and vertical placement. Whenever you have multiple widgets and you want to use them in a row or column; you can use Wrap widget to prevent content from getting clipped. You can name a direction, as horizontal or vertical according to the frontend you need for your application. Also, it helps to define the spacing between two widgets.

11. Opacity-

It is used to make a child inside the container transparent. Also, it changes the child into an intermediate buffer and makes it transparent temporarily. The remaining space rearranges itself, or you can keep it empty; you can do it by both ways.


 Article keywords:
flutter, flutter apps

 


 Share this article: 
Print Digg StumbleUpon del.icio.us Facebook Yahoo! Buzz Twitter Google Bookmarks LinkedIn MySpace Orkut PDF Scoopeo Viadeo Add to favorites
      

© Copyright - Articles XP