Skip to content

Commit

Permalink
feat: flutter_bloc: 2.0.0 #14
Browse files Browse the repository at this point in the history
  • Loading branch information
Gorniv committed Nov 21, 2019
1 parent 7e19570 commit e92e913
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to the "flutter-files" extension will be documented in this

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## [1.5.5] 21.11.2019

- support flutter_bloc ^2.0.0

## [1.5.4] 18.10.2019

- support flutter_bloc 0.22.1
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Copy [templates](./templates) directory to your project(root path) and change an

## Changelog

## 1.5.5

- support flutter_bloc ^2.0.0

## 1.5.4

- support flutter_bloc 0.22.1
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-flutter-files",
"displayName": "Flutter Files",
"description": "Quickly scaffold flutter bloc file templates",
"version": "1.5.4",
"version": "1.5.5",
"icon": "assets/icon.png",
"publisher": "gornivv",
"author": {
Expand Down
6 changes: 3 additions & 3 deletions templates/bloc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ class ${upperName}Bloc extends Bloc<${upperName}Event, ${upperName}State> {
${upperName}Bloc._internal();

@override
dispose(){
_${privateName}BlocSingleton.dispose();
super.dispose();
Future<void> close() async{
// dispose objects
super.close();
}

${upperName}State get initialState => Un${upperName}State(0);
Expand Down
4 changes: 2 additions & 2 deletions templates/screen.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class ${upperName}ScreenState extends State<${upperName}Screen> {
}

void _load([bool isError = false]) {
widget._${privateName}Bloc.dispatch(Un${upperName}Event());
widget._${privateName}Bloc.dispatch(Load${upperName}Event(isError));
widget._${privateName}Bloc.add(Un${upperName}Event());
widget._${privateName}Bloc.add(Load${upperName}Event(isError));
}
}
1 change: 0 additions & 1 deletion templates/state.tmpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:equatable/equatable.dart';
import 'package:meta/meta.dart';

@immutable
abstract class ${upperName}State extends Equatable {
/// notify change state without deep clone state
final int version;
Expand Down

0 comments on commit e92e913

Please sign in to comment.