Widgets in Flutter
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 :
- Text
- Icon
- TextInput
- Row and Column
- Stack
- Scaffold
- 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 :)