Skip to content

Instantly share code, notes, and snippets.

Last active Dec 13, 2018
What would you like to do?
//a statefull widget receive it values directly from the constructor,
//from doc : A widget that does not require mutable state.
class MyWidget extends StateFullWidget {
//final == val (kotlin)
//underscore _ means private in dart
final _myText = "";
//default constructor, braces {} means the arguments can be provided in any order
//_myText = text means _myText is initialised with the `text` value automatically
MyWidget({this.key, @required String text}) : _myText = text;
Widget build(BuildContext context) { //BuildContext => represents the parent widget
var imageUrl = "${_myText}";
return GestureDetector( //add user interraction
onTap: () { //lambdas without parameter, like kotlin
child: Row( //Row == Vertical LinearLayout
children: [
//download then display an image,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment