Professional Documents
Culture Documents
FLUTTER
MOBILE APPLICATION DEVELOPMENT (MAD)
IMPORT AND MAIN FUNCTION
import ‘package:flutter/material.dart’;
void main(){
}
Widget: MaterialApp()
WHAT IS A WIDGET?
The basic building blocks
Part of the user interface
No views, controllers, layouts, and other properties but just Widgets
Each widget has their own properties and usage
MATERIALAPP( )
A widget
Will create a Blank App
Allow to use Google Material design features
We can say it’s a wrapper for the other widgets
void main(){
runApp(MaterialApp( ));
}
MATERIALAPP( )
Inside a Widget we can add/use various properties to design the App Screen
runApp(MaterialApp(
));
home (property): will display the design we need to show on the Home Screen
TEXT( ) WIDGET
Used to show any text on the screen
runApp(MaterialApp(
));
WHAT IF WE NEED TO ADD
MORE THINGS ON THE HOME
SCREEN?
SCAFFOLD( ) WIDGET
Has different attributes
Will help us to setup the basic layout of the screen
Action Bar
Body
Floating Action Buttons
And more
runApp(MaterialApp(
home: Scaffold( ),
property_name: its_value
));
SCAFFOLD( ) WIDGET APP-
BAR
runApp(MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text( “ MAD Class “ ),
centerTitle: true,
),
),
));
Title Text, Color, Alignment
));
Title Text, Color, Alignment
));
Title Text, Color, Alignment
));
Title Text, Color, Alignment