Skip to content

Commit

Permalink
feat: upgrade templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Gorniv committed Dec 30, 2019
1 parent 2a322c7 commit fdb4e01
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This extension allows **quickly scaffold flutter BLoC templates** in VS Code pro

This extension use <https://github.com/felangel/bloc> for BLoC

## Support me - install my music player: [meows.app](https://meows.app?utm_source=ext&utm_medium=f_f)

![demo](https://github.com/Gorniv/vscode-flutter-files/raw/master/assets/flutter.gif)

## Custom(dynamic) templates
Expand All @@ -17,6 +19,10 @@ Copy [templates](./templates) directory to your project(root path) and change an

## Changelog

## 1.5.6

- update templates

## 1.5.5

- support flutter_bloc ^2.0.0
Expand Down
3 changes: 2 additions & 1 deletion templates/bloc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ class ${upperName}Bloc extends Bloc<${upperName}Event, ${upperName}State> {
@override
Future<void> close() async{
// dispose objects
super.close();
await super.close();
}

@override
${upperName}State get initialState => Un${upperName}State(0);

@override
Expand Down
2 changes: 1 addition & 1 deletion templates/event.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Load${upperName}Event extends ${upperName}Event {
}
await Future.delayed(Duration(seconds: 2));
this._${privateName}Repository.test(this.isError);
return In${upperName}State(0, "Hello world");
return In${upperName}State(0, 'Hello world');
} catch (_, stackTrace) {
developer.log('$_', name: 'Load${upperName}Event', error: _, stackTrace: stackTrace);
return Error${upperName}State(0, _?.toString());
Expand Down

0 comments on commit fdb4e01

Please sign in to comment.