Created
July 7, 2020 00:33
-
-
Save VB10/aa6b604b5be3500b3dbf2d45990fd2ee to your computer and use it in GitHub Desktop.
HWA FLUTTER SNIPPET
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
{ | |
"Magic number": { | |
"scope": "dart", | |
"prefix": "hwaMagicNumber", | |
"body": "static const $1 = $2;", | |
"description": "Hwa Magic Number Create" | |
}, | |
"SIngleton Eager": { | |
"scope": "dart", | |
"prefix": "hwaEager", | |
"body": [ | |
"class $1 {", | |
"static $1 _instace;", | |
"static $1 get instance {", | |
"if (_instace == null) _instace = $1._init();", | |
"return _instace;", | |
"}", | |
"$1._init();", | |
"}" | |
], | |
"description": "Hwa Magic Number Create" | |
}, | |
"Base View Model": { | |
"scope": "dart", | |
"prefix": "hwaBaseViewModel", | |
"body": [ | |
"void setContext(BuildContext context) => this.context = context;", | |
"void init() {}" | |
] | |
}, | |
"Base View ": { | |
"scope": "dart", | |
"prefix": "hwaBaseView", | |
"body": [ | |
"BaseView<$1>(", | |
"viewModel: $1(),", | |
"onModelReady: (model) {", | |
" model.setContext(context);", | |
"},", | |
"onPageBuilder: (BuildContext context,$1 value) => Scaffold(),", | |
");" | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment