Created
January 8, 2021 06:16
-
-
Save fundasarikaya/4a9e766ccac113a8d1571b9552e9e773 to your computer and use it in GitHub Desktop.
CoderFunda 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": "#MagicNumber", | |
"body":"static const $1=$2", | |
"description": "CoderFunda Magic Number Create" | |
}, | |
"Singleton Eager": { | |
"scope": "dart", | |
"prefix": "#SingletonEager", | |
"body":[ | |
"class $1{", | |
"static $1 _instance;", | |
"static $1 get instance {", | |
"if(_instance == null) _instance = $1._init();", | |
"return _instance;", | |
"}", | |
"$1._init();", | |
"}" | |
], | |
"description": "CoderFunda Singleton Eager Create" | |
}, | |
"Base View Model": { | |
"scope": "dart", | |
"prefix": "#BaseViewModel", | |
"body":[ | |
"void setContext(BuildContext context) =>this.context = context;", | |
"void init(){}" | |
], | |
"description": "CoderFunda Singleton Eager Create" | |
} | |
, | |
"Base View": { | |
"scope": "dart", | |
"prefix": "#BaseView", | |
"body":[ | |
"BaseView<$1>(", | |
"viewModel:$1(),", | |
"onModelReady: (model){", | |
" model.setContext(context);", | |
"},", | |
"onPageBuilder: (BuildContext context, $1 value) => Scaffold(),", | |
");" | |
], | |
"description": "CoderFunda Singleton Eager Create" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment