Boa tarde, eu achei como fazer um boilerplate no vscode para esse framework bloc, espero que ajude alguém:
- Vá nas configuraçãoes:
- Depois em User Snippets:
- E depois dart.json:
Dai é só adicionar o código a seguir para gerar o framework:
"Bloc Framework": {
"prefix": "bloc",
"body": [
"@immutable",
"abstract class $1State {",
" const $1State();",
"}",
"",
"@immutable",
"class Loading$1State extends $1State {",
" const Loading$1State();",
"}",
"",
"@immutable",
"class Init$1State extends $1State {",
" const Init$1State();",
"}",
"",
"@immutable",
"class Loaded$1State extends $1State {",
" final $4 _$3;",
"",
" const Loaded$1State(this._$3);",
"}",
"",
"@immutable",
"class FatalError$1State extends $1State {",
" const FatalError$1State();",
"}",
"",
"class $1Cubit extends Cubit<$1State> {",
" $1Cubit() : super(const Init$1State());",
"",
"}",
"",
"class $1Container extends BlocContainer {",
" const $1Container({Key? key}) : super(key: key);",
"",
" @override",
" Widget build(BuildContext context) {",
"",
" return BlocProvider<$1Cubit>(",
" create: (BuildContext context) {",
" final cubit = $1Cubit();",
" return cubit;",
" },",
" child: $2,",
" );",
" }",
"}"
],
"description": "Write the bloc framework",
},