Flutter Widgets
Flutter Widgets
Widgets
• In flutter, almost everything is a widget.
• A widget can:
• Display something: e.g. Text(‘Hello World’)
• Handle interaction with the user: e.g. Button(onTap: … callback)
• Specify the layout: e.g. Center, Container, Column, Row,
GridView, etc.
Composition
• Widgets are the building blocks
• Composition is the technique for creating a building from the blocks
• Building a Flutter app is like building a Lego set, piece by piece
Composition: An Example
• Check the following app and try to figure out
the widgets that compose the whole app.
• What basic widgets this app is build of?
Composition: An Example
• Looks like this app is composed of the
following Widgets:
• Image
• Text