Widgets in Flutter

Richa Sharma
1 min readJan 7, 2020

--

Widgets are the most important part of Flutter Application.

In simple words, everything in flutter is Widgets.

Widget is nothing more than a Dart class that extends a Flutter class.

Suppose for example :

class LoginWidget extends StatelessWidget {//code

}

Widget class require 1 build method which is mandatory to override.This build method returns other Widgets.

class DetailsPageOfMeetingList extends StatelessWidget{
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Meeting Details'),
backgroundColor: Colors.teal,
),
backgroundColor: Colors.white,
body:detailPage(),
)
);
}

There are 2 types of widgets Stateless and Statefull widgets which I covered in my previous blog.

You can add methods and properties in Widget class.

Most Common widgets are :

  1. Text
  2. Icon
  3. TextInput
  4. Row and Column
  5. Stack
  6. Scaffold
  7. Image

Flutter is unique in that every aspect of UI is handled with Widgets.

In my next I will explain Scaffold Widget in detail.

Happy Reading :)

--

--

No responses yet