Chapter 1
Chapter 1
What is flutter?
Flutter is Google’s portable UI framework for building modern, native, and reactive
applications for ios and Android.
Flutter is open-source?
Yes, Is an Open-source project hosted on GitHub.
What is dart?
Is the language that you’ll use to develop your flutter applications.
Dart is Ahead-of-time (AOT)?
Yes, dart is ahead-of-time(AOT) compiled to native code, making your flutter application fast.
Flutter is declarative?
Yes, in other words, flutter buils the ui to reflect the state of the app.
When the state (data) changes, the UI is redrawn, and flutter constructs a new instance of the
widget.
In what language is the flutter code compiled?
In ARM.
What do you have access to?
Use the graphics processing unit (GPU), and can access specific IOS and Android APIs( like
GPS location, image library)
What is a widget?
Widgets can be compared to LEGO blocks; you create an object, and by adding
different kinds of blocks.
For example:
Say an architect draws a blueprint of a house; All of the objects like walls, windows,
and doors in the house are the widgets.
And all of THEM WORK together to create the house or, in this case, the application.
Since widgets are the configuration pieces of the UI and together they create the widget
tree
Each stateless or stateful widdget has a build method with a BuildContext that handlesthe
location of the widget in the widget tree.
What is?
A statefulWidget is built based on its own configuration but can change dynamically.
The values can change based on the user’s interaction.
setState() -> you call the method to notify the framework that this object has changes.
You can override different portions of the statefulWidget to customize and manipulate data at
different points of the widget lifecycle.
METHOD:
initState() -> Called once when this object is inserted into the tree.
@override
Void initState(){
Super.initState():
Print(‘iinitState’);
}
Dispose() -> called when this object is removed from the tree permanently
@override
Void dispose(){
Print(‘dispose’);
Super.dispose();
}
@override
Void didUpdateWIdget(Contacts oldWidget){
Super.didUpdateWidget(oldWidget);
Print(‘didUpdateWidget: $oldWidget’);
}
Deactivate() -> called when this object is removed from the tree.
@override
Void deactivate(){
Print(‘deactivate’);
Super. deactivate();
}
Build(BuildContext context) -> Can be called multiple times to build the UI, and the
BuildCOntext handles the location of this widget in the widget tree.
@override
Widget build(BuildContext context){
Print(‘build’);
Return Container();
}
setState() -> Notifies the framework that that the state of this object has changed to schedule
calling the build for this state object
setState( () {
name =_newValue;
}
069891111
Rue peaul posture db à tournai
19 Août , c’est la formation d’électricité
Si vous n’êtes
Lorsque vous créez un appareil virtuel Android (AVD) dans AVD Manager, vous
pouvez spécifier si l'émulateur doit utiliser l'accélération matérielle ou logicielle
pour émuler le GPU de l'AVD. L'accélération matérielle, qui est généralement
plus rapide, est recommandée. Toutefois, vous devrez peut-être recourir à
l'accélération logicielle si votre ordinateur utilise des pilotes graphiques non
compatibles avec l'émulateur.
On peut faire ce pas dans l’application, mais on peut aussi spécifier un type d’accélération
graphique :
Emulator -avd avd_name -gpu mode [{-option [value]}]
Emulator -avd avd_application -gpu mode auto
mode:
auto, host, swiftshader_indirect, angle_indirect, guest
Si vous activez une option d'accélération graphique non compatible avec votre ordinateur,
des images incorrectes risquent de s'afficher lors de l'émulation.
su
setprop debug.hwui.renderer skiagl
stop
start
Configurer l’accélération de la VM sous Windows :
Windows Hypervisor Platform (WHPX)
Android Emulator Hypervisor Driver (AEHD)
Vous n’avez pas besoin d’exécuter Hyper-V en même temps qu’Android Emulator.