Last active
December 13, 2018 07:49
-
-
Save florent37/e5ca77e8d6891d1925f662d104c632c4 to your computer and use it in GitHub Desktop.
Revisions
-
florent37 revised this gist
Dec 13, 2018 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,7 @@ 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 -
florent37 revised this gist
Dec 12, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ class MyWidget extends StateFullWidget { @override Widget build(BuildContext context) { //BuildContext => represents the parent widget var imageUrl = "www.mywebsites.com/${_myText}"; return GestureDetector( //add user interraction onTap: () { //lambdas without parameter, like kotlin print("tapped"); }, -
florent37 revised this gist
Dec 12, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ //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) final _myText = ""; //default constructor, braces {} means the arguments can be provided in any order -
florent37 revised this gist
Dec 12, 2018 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -18,6 +18,7 @@ class MyWidget extends StateFullWidget { }, child: Row( //Row == Vertical LinearLayout children: [ //download then display an image Image.network(imageUrl), Text(_myText) ] -
florent37 revised this gist
Dec 12, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ class MyWidget extends StateFullWidget { MyWidget({this.key, @required String text}) : _myText = text; @override Widget build(BuildContext context) { //BuildContext => represents the parent widget var imageUrl = "www.mywebsites.com/${_myText}"; return GestureDetector( onTap: () { //lambdas without parameter, like kotlin -
florent37 revised this gist
Dec 12, 2018 . 1 changed file with 10 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,23 @@ //a statefull widget receive it values directly from the constructor, //here the method build is called once class MyWidget extends StateFullWidget { //final == val 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; @override Widget build(BuildContext context) { //BuildContext => the current position on the widget trees + its parent's size var imageUrl = "www.mywebsites.com/${_myText}"; return GestureDetector( onTap: () { //lambdas without parameter, like kotlin print("tapped"); }, child: Row( //Row == Vertical LinearLayout children: [ Image.network(imageUrl), Text(_myText) ] -
florent37 created this gist
Dec 12, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ class MyWidget extends StateFullWidget { final _myText = ""; MyWidget({this.key, String text}) : _myText = text; @override Widget build(BuildContext context) { var imageUrl = "www.mywebsites.com/${_myText}"; return GestureDetector( onTap: () { print("tapped"); }, child: Row( children: [ Image.network(imageUrl), Text(_myText) ] ) ) } }