Created
April 4, 2019 14:42
-
-
Save MarcioQuimbundo/9b44df80f6c1a5169ffbf6e94656fe80 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/widgets.dart'; | |
main() => runApp( | |
Directionality( | |
textDirection: TextDirection.ltr, | |
child: Center( | |
child: WidgetSemEstado("Mundo!!!"), | |
), | |
), | |
); | |
class WidgetSemEstado extends StatelessWidget { | |
//todas as propriedades do StatelessWidget devem ser declaradas com as palavras chaves "final" ou "const" | |
//const é utilizado para constantes em tempo de compilação | |
//final só podem ser definidas apenas uma vez | |
final String nome;//propriedade da class | |
WidgetSemEstado(this.nome);// construtora da class | |
@override | |
Widget build(BuildContext context) { | |
return Text( | |
'Olá, $nome', | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment