SlideShare a Scribd company logo
1 of 25
CSE-4078
MOBILE APPLICATION
DEVELOPMENT
LECTURES – WEEK 3
SARA MASOOD
OUTLINE
 Container
 Safe area
 Column
 Rows
WIDGET STATE
 State is information that
 can be read synchronously when the widget is built
 might change during the lifetime of the widget
 StatefulWidget
 StatelessWidget
Click to add text
STATELESS WIDGET
 A widget that does not require mutable state.
 Stateless widget are useful when the part of the user interface you are describing
does not depend on anything other than the configuration information in the object
itself
 In simple words, Stateless widgets cannot change their state during the runtime of
the app, which means the widgets cannot be redrawn while the app is in action.
 TIPS: You can quickly build a Stateless Widget in VS Code or Android Studio by using
the shortcut “stless”.
 StatelessWidget class - widgets library - Dart API (flutter.dev)
STATELESS WIDGET - IMPLEMENTATION
class GreenFrog extends StatelessWidget {
const GreenFrog({ Key? key }) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(color: const Color(0xFF2DBD3A));
}
}
STATEFUL WIDGET
 A widget that has mutable state.
 They are the widgets which can change their state multiple times and can be redrawn
on to the screen any number of times while the app is in action.
 Tip: you can quickly build a Stateful Widget in VS Code or Android Studio by using
the shortcut “stf”.
 Stateful widgets are useful when the part of the user interface you are describing can
change dynamically, e.g. due to having an internal clock-driven state, or depending
on some system state
 StatefulWidget class - widgets library - Dart API (flutter.dev)
 Implementation due in next week.
SAFE AREA
 A widget that insets its child by sufficient padding to avoid intrusions by the
operating system.
 For example, this will indent the child by enough to avoid the status bar at the top of
the screen.
 SafeArea class - widgets library - Dart API (flutter.dev)
body: SafeArea(
child: Center(),
))
CONTAINER
 One of the most used Widgets — and for good reasons:
 Container as a layout tool
 When you don’t specify the height and the width of the Container, it will match its child’s size
 Code :
 Scaffold(
appBar: AppBar(title: Text('Container as a layout')),
body: Container(
color: Colors.yellowAccent,
child: Text("Hi"),
),);
COLUMNS AND ROWS
COLUMN
 A widget that displays its children in a vertical array.
MAINAXISES
 Row /*or Column*/(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Icon(Icons.star, size: 50),
Icon(Icons.star, size: 50),
Icon(Icons.star, size: 50),
],
)
MAINAXISES
VERTICAL DIRECTION / UP DOWN
CROSS AXIS ALIGNMENT
Row /*or Column*/(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Icon(Icons.star, size: 50),
Icon(Icons.star, size: 200),
Icon(Icons.star, size: 50),
],
),
CROSSAXIS ALIGNMENT
COLUMN CROSS AXIS ALIGNMENT EXAMPLE 2
COLUMN CROSSAXISALIGNMENT EXAMPLE 2
ROWS CROSS AXES ALIGNMENT
SIZE BOX
 Use to give spacing between childrenSizedBox as padding
 When in need of adding padding or margin, you might choose Padding or Container
widgets. But they can be more verbose and less readable than adding a Sizedbox
 Column(
children: <Widget>[
Icon(Icons.star, size: 50),
const SizedBox(height: 100),
Icon(Icons.star, size: 50),
Icon(Icons.star, size: 50),
],
),
MARGIN
 margin: EdgeInsets.all(20.0)
 Margin: EdgeInsert. Symmetric(vertical:50.0, Horizontal:10)
 Margin: EdgeInsert.fromLTRB(20,10,50,30)
 Margin: EdgeInsert.only(left:!0)
PADDING
 padding: EdgeInsets.all(20.0)
 Padding: EdgeInsert.Symmetric(vertical:50.0, Horizontal:10)
 Padding: EdgeInsert.fromLTRB(20,10,50,30)
 Padding: EdgeInsert.only(left:!0)
CIRCLEAVATAR
 A circle that represents a user.
 Typically used with a user's profile image, or, in the absence of such an image, the
user's initials
 CircleAvatar(
 backgroundImage: NetworkImage(userAvatarUrl),
 )
 CircleAvatar class - material library - Dart API (flutter.dev)
CARD
 A material design card: a panel with slightly rounded corners and an elevation shadow.
Card(
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const ListTile(
leading: Icon(Icons.album, size: 45),
title: Text('Sonu Nigam'),
subtitle: Text('Best of Sonu Nigam Song'),
), ], ), );
 Card class - material library - Dart API (flutter.dev)
LISTTILE
 A single fixed-height row that typically contains some text as well as a leading or
trailing icon
ListTile(
leading: FlutterLogo(),
title: Text('One-line with'),
)
 ListTile class - material library - Dart API (flutter.dev)
USEFUL LINKS
 Flutter Layout Cheat Sheet. Do you need simple layout samples for… | by
Tomek Polański | Flutter Community | Medium
 Material Design Color Palette Generator - Material Palette
 Browse Fonts - Google Fonts

More Related Content

Similar to CSE-4078 - Lecture - Week 3sasdgaga.pptx

CodeMash - Building Rich Apps with Groovy SwingBuilder
CodeMash - Building Rich Apps with Groovy SwingBuilderCodeMash - Building Rich Apps with Groovy SwingBuilder
CodeMash - Building Rich Apps with Groovy SwingBuilderAndres Almiray
 
Mobile Application Development -Lecture 07 & 08.pdf
Mobile Application Development -Lecture 07 & 08.pdfMobile Application Development -Lecture 07 & 08.pdf
Mobile Application Development -Lecture 07 & 08.pdfAbdullahMunir32
 
What's New in Android
What's New in AndroidWhat's New in Android
What's New in AndroidRobert Cooper
 
android layouts
android layoutsandroid layouts
android layoutsDeepa Rani
 
Developer Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for BeginnersDeveloper Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for BeginnersJiaxuan Lin
 
Programming with JavaFX
Programming with JavaFXProgramming with JavaFX
Programming with JavaFXFulvio Corno
 
01 09 - graphical user interface - basic widgets
01  09 - graphical user interface - basic widgets01  09 - graphical user interface - basic widgets
01 09 - graphical user interface - basic widgetsSiva Kumar reddy Vasipally
 
Abstract Window Toolkit
Abstract Window ToolkitAbstract Window Toolkit
Abstract Window ToolkitRutvaThakkar1
 
GUI Programming In Java
GUI Programming In JavaGUI Programming In Java
GUI Programming In Javayht4ever
 
Android development for iOS developers
Android development for iOS developersAndroid development for iOS developers
Android development for iOS developersDarryl Bayliss
 
Fragments: Why, How, What For?
Fragments: Why, How, What For?Fragments: Why, How, What For?
Fragments: Why, How, What For?Brenda Cook
 
Android Screen Containers & Layouts
Android Screen Containers & LayoutsAndroid Screen Containers & Layouts
Android Screen Containers & LayoutsVijay Rastogi
 
GUI design using JAVAFX.ppt
GUI design using JAVAFX.pptGUI design using JAVAFX.ppt
GUI design using JAVAFX.pptTabassumMaktum
 
A Guide to Creating a Great Custom Tailwind Sidebar
A Guide to Creating a Great Custom Tailwind SidebarA Guide to Creating a Great Custom Tailwind Sidebar
A Guide to Creating a Great Custom Tailwind SidebarRonDosh
 
Intro to JavaFX & Widget FX
Intro to JavaFX & Widget FXIntro to JavaFX & Widget FX
Intro to JavaFX & Widget FXStephen Chin
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CNjojule
 

Similar to CSE-4078 - Lecture - Week 3sasdgaga.pptx (20)

CodeMash - Building Rich Apps with Groovy SwingBuilder
CodeMash - Building Rich Apps with Groovy SwingBuilderCodeMash - Building Rich Apps with Groovy SwingBuilder
CodeMash - Building Rich Apps with Groovy SwingBuilder
 
Hello Android
Hello AndroidHello Android
Hello Android
 
Mobile Application Development -Lecture 07 & 08.pdf
Mobile Application Development -Lecture 07 & 08.pdfMobile Application Development -Lecture 07 & 08.pdf
Mobile Application Development -Lecture 07 & 08.pdf
 
What's New in Android
What's New in AndroidWhat's New in Android
What's New in Android
 
android layouts
android layoutsandroid layouts
android layouts
 
Developer Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for BeginnersDeveloper Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for Beginners
 
Programming with JavaFX
Programming with JavaFXProgramming with JavaFX
Programming with JavaFX
 
01 09 - graphical user interface - basic widgets
01  09 - graphical user interface - basic widgets01  09 - graphical user interface - basic widgets
01 09 - graphical user interface - basic widgets
 
Abstract Window Toolkit
Abstract Window ToolkitAbstract Window Toolkit
Abstract Window Toolkit
 
GUI Programming In Java
GUI Programming In JavaGUI Programming In Java
GUI Programming In Java
 
Android development for iOS developers
Android development for iOS developersAndroid development for iOS developers
Android development for iOS developers
 
Android Ui
Android UiAndroid Ui
Android Ui
 
Android UI
Android UI Android UI
Android UI
 
Fragments: Why, How, What For?
Fragments: Why, How, What For?Fragments: Why, How, What For?
Fragments: Why, How, What For?
 
Android Screen Containers & Layouts
Android Screen Containers & LayoutsAndroid Screen Containers & Layouts
Android Screen Containers & Layouts
 
GUI design using JAVAFX.ppt
GUI design using JAVAFX.pptGUI design using JAVAFX.ppt
GUI design using JAVAFX.ppt
 
A Guide to Creating a Great Custom Tailwind Sidebar
A Guide to Creating a Great Custom Tailwind SidebarA Guide to Creating a Great Custom Tailwind Sidebar
A Guide to Creating a Great Custom Tailwind Sidebar
 
Intro to JavaFX & Widget FX
Intro to JavaFX & Widget FXIntro to JavaFX & Widget FX
Intro to JavaFX & Widget FX
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CN
 
Svcc 2013-d3
Svcc 2013-d3Svcc 2013-d3
Svcc 2013-d3
 

Recently uploaded

Beautiful Vip Call Girls Punjabi Bagh 9711199012 Call /Whatsapps
Beautiful Vip  Call Girls Punjabi Bagh 9711199012 Call /WhatsappsBeautiful Vip  Call Girls Punjabi Bagh 9711199012 Call /Whatsapps
Beautiful Vip Call Girls Punjabi Bagh 9711199012 Call /Whatsappssapnasaifi408
 
UNOSAFE ELEVATOR PRIVATE LTD BANGALORE BROUCHER
UNOSAFE ELEVATOR PRIVATE LTD BANGALORE BROUCHERUNOSAFE ELEVATOR PRIVATE LTD BANGALORE BROUCHER
UNOSAFE ELEVATOR PRIVATE LTD BANGALORE BROUCHERunosafeads
 
UNIT-III-TRANSMISSION SYSTEMS REAR AXLES
UNIT-III-TRANSMISSION SYSTEMS REAR AXLESUNIT-III-TRANSMISSION SYSTEMS REAR AXLES
UNIT-III-TRANSMISSION SYSTEMS REAR AXLESDineshKumar4165
 
call girls in G.T.B. Nagar (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in  G.T.B. Nagar (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in  G.T.B. Nagar (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in G.T.B. Nagar (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Innovating Manufacturing with CNC Technology
Innovating Manufacturing with CNC TechnologyInnovating Manufacturing with CNC Technology
Innovating Manufacturing with CNC Technologyquickpartslimitlessm
 
꧁༒☬ 7042364481 (Call Girl) In Dwarka Delhi Escort Service In Delhi Ncr☬༒꧂
꧁༒☬ 7042364481 (Call Girl) In Dwarka Delhi Escort Service In Delhi Ncr☬༒꧂꧁༒☬ 7042364481 (Call Girl) In Dwarka Delhi Escort Service In Delhi Ncr☬༒꧂
꧁༒☬ 7042364481 (Call Girl) In Dwarka Delhi Escort Service In Delhi Ncr☬༒꧂Hot Call Girls In Sector 58 (Noida)
 
Call me @ 9892124323 Call Girl in Andheri East With Free Home Delivery
Call me @ 9892124323 Call Girl in Andheri East With Free Home DeliveryCall me @ 9892124323 Call Girl in Andheri East With Free Home Delivery
Call me @ 9892124323 Call Girl in Andheri East With Free Home DeliveryPooja Nehwal
 
Hot And Sexy 🥵 Call Girls Delhi Daryaganj {9711199171} Ira Malik High class G...
Hot And Sexy 🥵 Call Girls Delhi Daryaganj {9711199171} Ira Malik High class G...Hot And Sexy 🥵 Call Girls Delhi Daryaganj {9711199171} Ira Malik High class G...
Hot And Sexy 🥵 Call Girls Delhi Daryaganj {9711199171} Ira Malik High class G...shivangimorya083
 
Not Sure About VW EGR Valve Health Look For These Symptoms
Not Sure About VW EGR Valve Health Look For These SymptomsNot Sure About VW EGR Valve Health Look For These Symptoms
Not Sure About VW EGR Valve Health Look For These SymptomsFifth Gear Automotive
 
John Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service Manual
John Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service ManualJohn Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service Manual
John Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service ManualExcavator
 
Crash Vehicle Emergency Rescue Slideshow.ppt
Crash Vehicle Emergency Rescue Slideshow.pptCrash Vehicle Emergency Rescue Slideshow.ppt
Crash Vehicle Emergency Rescue Slideshow.pptVlademirGebDubouzet1
 
Hauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhi
Hauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhiHauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhi
Hauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhiHot Call Girls In Sector 58 (Noida)
 
John Deere Tractors 5515 Diagnostic Repair Manual
John Deere Tractors 5515 Diagnostic Repair ManualJohn Deere Tractors 5515 Diagnostic Repair Manual
John Deere Tractors 5515 Diagnostic Repair ManualExcavator
 
Digamma - CertiCon Team Skills and Qualifications
Digamma - CertiCon Team Skills and QualificationsDigamma - CertiCon Team Skills and Qualifications
Digamma - CertiCon Team Skills and QualificationsMihajloManjak
 
定制(UW毕业证书)华盛顿大学毕业证成绩单原版一比一
定制(UW毕业证书)华盛顿大学毕业证成绩单原版一比一定制(UW毕业证书)华盛顿大学毕业证成绩单原版一比一
定制(UW毕业证书)华盛顿大学毕业证成绩单原版一比一ffhuih11ff
 
Digamma / CertiCon Company Presentation
Digamma / CertiCon Company  PresentationDigamma / CertiCon Company  Presentation
Digamma / CertiCon Company PresentationMihajloManjak
 
UNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGER
UNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGERUNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGER
UNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGERDineshKumar4165
 
UNIT-1-VEHICLE STRUCTURE AND ENGINES.ppt
UNIT-1-VEHICLE STRUCTURE AND ENGINES.pptUNIT-1-VEHICLE STRUCTURE AND ENGINES.ppt
UNIT-1-VEHICLE STRUCTURE AND ENGINES.pptDineshKumar4165
 

Recently uploaded (20)

Beautiful Vip Call Girls Punjabi Bagh 9711199012 Call /Whatsapps
Beautiful Vip  Call Girls Punjabi Bagh 9711199012 Call /WhatsappsBeautiful Vip  Call Girls Punjabi Bagh 9711199012 Call /Whatsapps
Beautiful Vip Call Girls Punjabi Bagh 9711199012 Call /Whatsapps
 
UNOSAFE ELEVATOR PRIVATE LTD BANGALORE BROUCHER
UNOSAFE ELEVATOR PRIVATE LTD BANGALORE BROUCHERUNOSAFE ELEVATOR PRIVATE LTD BANGALORE BROUCHER
UNOSAFE ELEVATOR PRIVATE LTD BANGALORE BROUCHER
 
UNIT-III-TRANSMISSION SYSTEMS REAR AXLES
UNIT-III-TRANSMISSION SYSTEMS REAR AXLESUNIT-III-TRANSMISSION SYSTEMS REAR AXLES
UNIT-III-TRANSMISSION SYSTEMS REAR AXLES
 
call girls in G.T.B. Nagar (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in  G.T.B. Nagar (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in  G.T.B. Nagar (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in G.T.B. Nagar (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Innovating Manufacturing with CNC Technology
Innovating Manufacturing with CNC TechnologyInnovating Manufacturing with CNC Technology
Innovating Manufacturing with CNC Technology
 
꧁༒☬ 7042364481 (Call Girl) In Dwarka Delhi Escort Service In Delhi Ncr☬༒꧂
꧁༒☬ 7042364481 (Call Girl) In Dwarka Delhi Escort Service In Delhi Ncr☬༒꧂꧁༒☬ 7042364481 (Call Girl) In Dwarka Delhi Escort Service In Delhi Ncr☬༒꧂
꧁༒☬ 7042364481 (Call Girl) In Dwarka Delhi Escort Service In Delhi Ncr☬༒꧂
 
Hotel Escorts Sushant Golf City - 9548273370 Call Girls Service in Lucknow, c...
Hotel Escorts Sushant Golf City - 9548273370 Call Girls Service in Lucknow, c...Hotel Escorts Sushant Golf City - 9548273370 Call Girls Service in Lucknow, c...
Hotel Escorts Sushant Golf City - 9548273370 Call Girls Service in Lucknow, c...
 
Call me @ 9892124323 Call Girl in Andheri East With Free Home Delivery
Call me @ 9892124323 Call Girl in Andheri East With Free Home DeliveryCall me @ 9892124323 Call Girl in Andheri East With Free Home Delivery
Call me @ 9892124323 Call Girl in Andheri East With Free Home Delivery
 
Hot And Sexy 🥵 Call Girls Delhi Daryaganj {9711199171} Ira Malik High class G...
Hot And Sexy 🥵 Call Girls Delhi Daryaganj {9711199171} Ira Malik High class G...Hot And Sexy 🥵 Call Girls Delhi Daryaganj {9711199171} Ira Malik High class G...
Hot And Sexy 🥵 Call Girls Delhi Daryaganj {9711199171} Ira Malik High class G...
 
Not Sure About VW EGR Valve Health Look For These Symptoms
Not Sure About VW EGR Valve Health Look For These SymptomsNot Sure About VW EGR Valve Health Look For These Symptoms
Not Sure About VW EGR Valve Health Look For These Symptoms
 
John Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service Manual
John Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service ManualJohn Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service Manual
John Deere 300 3029 4039 4045 6059 6068 Engine Operation and Service Manual
 
Crash Vehicle Emergency Rescue Slideshow.ppt
Crash Vehicle Emergency Rescue Slideshow.pptCrash Vehicle Emergency Rescue Slideshow.ppt
Crash Vehicle Emergency Rescue Slideshow.ppt
 
Hauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhi
Hauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhiHauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhi
Hauz Khas Call Girls ☎ 7042364481 independent Escorts Service in delhi
 
John Deere Tractors 5515 Diagnostic Repair Manual
John Deere Tractors 5515 Diagnostic Repair ManualJohn Deere Tractors 5515 Diagnostic Repair Manual
John Deere Tractors 5515 Diagnostic Repair Manual
 
Digamma - CertiCon Team Skills and Qualifications
Digamma - CertiCon Team Skills and QualificationsDigamma - CertiCon Team Skills and Qualifications
Digamma - CertiCon Team Skills and Qualifications
 
定制(UW毕业证书)华盛顿大学毕业证成绩单原版一比一
定制(UW毕业证书)华盛顿大学毕业证成绩单原版一比一定制(UW毕业证书)华盛顿大学毕业证成绩单原版一比一
定制(UW毕业证书)华盛顿大学毕业证成绩单原版一比一
 
Digamma / CertiCon Company Presentation
Digamma / CertiCon Company  PresentationDigamma / CertiCon Company  Presentation
Digamma / CertiCon Company Presentation
 
Indian Downtown Call Girls # 00971528903066 # Indian Call Girls In Downtown D...
Indian Downtown Call Girls # 00971528903066 # Indian Call Girls In Downtown D...Indian Downtown Call Girls # 00971528903066 # Indian Call Girls In Downtown D...
Indian Downtown Call Girls # 00971528903066 # Indian Call Girls In Downtown D...
 
UNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGER
UNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGERUNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGER
UNIT-II-ENGINE AUXILIARY SYSTEMS &TURBOCHARGER
 
UNIT-1-VEHICLE STRUCTURE AND ENGINES.ppt
UNIT-1-VEHICLE STRUCTURE AND ENGINES.pptUNIT-1-VEHICLE STRUCTURE AND ENGINES.ppt
UNIT-1-VEHICLE STRUCTURE AND ENGINES.ppt
 

CSE-4078 - Lecture - Week 3sasdgaga.pptx

  • 2. OUTLINE  Container  Safe area  Column  Rows
  • 3. WIDGET STATE  State is information that  can be read synchronously when the widget is built  might change during the lifetime of the widget  StatefulWidget  StatelessWidget Click to add text
  • 4. STATELESS WIDGET  A widget that does not require mutable state.  Stateless widget are useful when the part of the user interface you are describing does not depend on anything other than the configuration information in the object itself  In simple words, Stateless widgets cannot change their state during the runtime of the app, which means the widgets cannot be redrawn while the app is in action.  TIPS: You can quickly build a Stateless Widget in VS Code or Android Studio by using the shortcut “stless”.  StatelessWidget class - widgets library - Dart API (flutter.dev)
  • 5. STATELESS WIDGET - IMPLEMENTATION class GreenFrog extends StatelessWidget { const GreenFrog({ Key? key }) : super(key: key); @override Widget build(BuildContext context) { return Container(color: const Color(0xFF2DBD3A)); } }
  • 6. STATEFUL WIDGET  A widget that has mutable state.  They are the widgets which can change their state multiple times and can be redrawn on to the screen any number of times while the app is in action.  Tip: you can quickly build a Stateful Widget in VS Code or Android Studio by using the shortcut “stf”.  Stateful widgets are useful when the part of the user interface you are describing can change dynamically, e.g. due to having an internal clock-driven state, or depending on some system state  StatefulWidget class - widgets library - Dart API (flutter.dev)  Implementation due in next week.
  • 7. SAFE AREA  A widget that insets its child by sufficient padding to avoid intrusions by the operating system.  For example, this will indent the child by enough to avoid the status bar at the top of the screen.  SafeArea class - widgets library - Dart API (flutter.dev) body: SafeArea( child: Center(), ))
  • 8. CONTAINER  One of the most used Widgets — and for good reasons:  Container as a layout tool  When you don’t specify the height and the width of the Container, it will match its child’s size  Code :  Scaffold( appBar: AppBar(title: Text('Container as a layout')), body: Container( color: Colors.yellowAccent, child: Text("Hi"), ),);
  • 10. COLUMN  A widget that displays its children in a vertical array.
  • 11. MAINAXISES  Row /*or Column*/( mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[ Icon(Icons.star, size: 50), Icon(Icons.star, size: 50), Icon(Icons.star, size: 50), ], )
  • 14. CROSS AXIS ALIGNMENT Row /*or Column*/( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Icon(Icons.star, size: 50), Icon(Icons.star, size: 200), Icon(Icons.star, size: 50), ], ),
  • 16. COLUMN CROSS AXIS ALIGNMENT EXAMPLE 2
  • 18. ROWS CROSS AXES ALIGNMENT
  • 19. SIZE BOX  Use to give spacing between childrenSizedBox as padding  When in need of adding padding or margin, you might choose Padding or Container widgets. But they can be more verbose and less readable than adding a Sizedbox  Column( children: <Widget>[ Icon(Icons.star, size: 50), const SizedBox(height: 100), Icon(Icons.star, size: 50), Icon(Icons.star, size: 50), ], ),
  • 20. MARGIN  margin: EdgeInsets.all(20.0)  Margin: EdgeInsert. Symmetric(vertical:50.0, Horizontal:10)  Margin: EdgeInsert.fromLTRB(20,10,50,30)  Margin: EdgeInsert.only(left:!0)
  • 21. PADDING  padding: EdgeInsets.all(20.0)  Padding: EdgeInsert.Symmetric(vertical:50.0, Horizontal:10)  Padding: EdgeInsert.fromLTRB(20,10,50,30)  Padding: EdgeInsert.only(left:!0)
  • 22. CIRCLEAVATAR  A circle that represents a user.  Typically used with a user's profile image, or, in the absence of such an image, the user's initials  CircleAvatar(  backgroundImage: NetworkImage(userAvatarUrl),  )  CircleAvatar class - material library - Dart API (flutter.dev)
  • 23. CARD  A material design card: a panel with slightly rounded corners and an elevation shadow. Card( child: Column( mainAxisSize: MainAxisSize.min, children: <Widget>[ const ListTile( leading: Icon(Icons.album, size: 45), title: Text('Sonu Nigam'), subtitle: Text('Best of Sonu Nigam Song'), ), ], ), );  Card class - material library - Dart API (flutter.dev)
  • 24. LISTTILE  A single fixed-height row that typically contains some text as well as a leading or trailing icon ListTile( leading: FlutterLogo(), title: Text('One-line with'), )  ListTile class - material library - Dart API (flutter.dev)
  • 25. USEFUL LINKS  Flutter Layout Cheat Sheet. Do you need simple layout samples for… | by Tomek Polański | Flutter Community | Medium  Material Design Color Palette Generator - Material Palette  Browse Fonts - Google Fonts