Last active
May 8, 2020 19:34
-
-
Save mehmetf/e00fcb718f3592ac05d91a062d26cba0 to your computer and use it in GitHub Desktop.
Passing Params
This file contains 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
class MyPage extends StatelessWidget { | |
final int accountId; | |
final int scopeId; | |
MyPage(this.accountId, this.scopeId); | |
Widget build(BuildContext context) { | |
return new MyWidget(accountId, scopeId); | |
} | |
} | |
class MyWidget extends StatelessWidget { | |
final int accountId; | |
final int scopeId; | |
MyWidget(this.accountId, this.scopeId); | |
Widget build(BuildContext context) { | |
// somewhere down the line | |
new MyOtherWidget(accountId, scopeId); | |
... | |
} | |
} | |
class MyOtherWidget extends StatelessWidget { | |
final int accountId; | |
final int scopeId; | |
MyOtherWidget(this.accountId, this.scopeId); | |
Widget build(BuildContext context) { | |
// rinse and repeat | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment