flutter Flashcards
ctrl + shift + p
flutter
declaration variables
int edad = 25;
double altura = 1.75;
String nombre = “Juan”;
bool esMayor = true;
inferencia de tipo
var altura = 1.75;
diference between: final // const
both don’ t changes once declared
final: at runtime
final hora = DateTime.now().hour;
final nombre = obtenerNombreUsuario();
const: in the start
const pi = 3.14159;
const NOMBRE_APP = “Mi Aplicación”;
$count = 100
print(‘$count’)
flutter: select devices
widgets => legos
types of widgets
statelessWidgets
without state
final name=’western’
statefullWidgets
with state
String nombre=’dress up ‘
trees of widgets
only begin in a simple widget
tree of vectors
where is main
my_carptet/lib/main.dart
hello world
example 1
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Text(‘Hello World!’),
);
}
}
example 2
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Center(
child: Text(‘Hello, World!’),
)
);
}
}
debugger (di-ba-guer) // depurador
modify widget
ctrol + .
scaffold (escafolf => andamio)
if have more than => 2 CHILDREN
you should use => COLUM