Last active
July 5, 2021 09:07
-
-
Save pszklarska/e73813871d1dd23caec8875d5d035617 to your computer and use it in GitHub Desktop.
Flutter Redux User Snippet for VSC
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 characters
{ | |
"Create new Page with Redux template": { | |
"prefix": "redux", | |
"body": [ | |
"import 'package:flutter/material.dart';", | |
"import 'package:flutter_redux/flutter_redux.dart';", | |
"import 'package:redux/redux.dart';", | |
"class ${1:name}Page extends StatelessWidget {", | |
" @override", | |
" Widget build(BuildContext context) {", | |
" return StoreConnector<$0AppState, ${1:name}ViewModel>(", | |
" converter: (store) => ${1:name}ViewModel(store),", | |
" builder: (context, viewModel) => _${1:name}Page(viewModel),", | |
" );", | |
" }", | |
"}", | |
"", | |
"class _${1:name}Page extends StatelessWidget {", | |
" final ${1:name}ViewModel viewModel;", | |
" _${1:name}Page(this.viewModel);", | |
" @override", | |
" Widget build(BuildContext context) {", | |
" return Container();", | |
" }", | |
"}", | |
"", | |
"@immutable", | |
"class ${1:name}ViewModel {", | |
" ${1:name}ViewModel(this._store);", | |
" final Store<AppState> _store;", | |
"}" | |
], | |
"description": "Create new Page with Redux template" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment