Download as pdf or txt
Download as pdf or txt
You are on page 1of 28

Chapitre 2 : Widgets

https://flutter.dev/docs/development/ui/widgets
C’est quoi un Widget ?
1- Stateless widget
Child and children
1er exemple complet
Exemple 2 : avec classe séparée : Hello - rectangle

https://github.com/flutter/udacity-course/blob/master/course/
01_hello_rectangle/solution_01_hello_rectangle/lib/main.dart
Code Source

https://github.com/flutter/udacity-course/blob/master/course/01_hello_rectangle/solution_01_hello_rectangle/lib/main.dart
Cutomizable Widget

?
Exemple d’utilisation des widgets

?
Pseudo codes
2- StateFul widget

Stateless Widgets Stateful Widgets


Let’s create a simple StatelessWidget with just a checkbox
convert the StatelessWidget into a StatefulWidget
3- AppBar :

Code source : https://api.flutter.dev/flutter/material/AppBar-class.html


4- TabBar :

Code source : https://api.flutter.dev/flutter/material/TabBar-class.html


5- Floating AppBar
To make it easier for users to view a list of items, you might
want to hide the app bar as the user scrolls down the list.
This is especially true if your app displays a “tall” app bar
that occupies a lot of vertical space.

Code source : https://flutter.dev/docs/cookbook/lists/floating-app-bar


6- Column and Row :

Code source : https://api.flutter.dev/flutter/material/TabBar-class.html


Code source : https://api.flutter.dev/flutter/material/TabBar-class.html
7- Flexible widgets :

Code source : https://api.flutter.dev/flutter/widgets/Flexible-class.html


8- Expandable

Priorité

Code source : https://api.flutter.dev/flutter/widgets/Expanded-class.html


9- Container

Code source : https://api.flutter.dev/flutter/widgets/Container-class.html


10- Image

Code source : https://flutter.dev/docs/cookbook/images/fading-in-images


11 – Material Button

Code source : https://material.io/components/buttons


9-

Code source :
9-

Code source :
9-

Code source :

You might also like