Skip to content

Commit

Permalink
feat: support v.6 bloc
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Kravchenko authored and Igor Kravchenko committed Aug 15, 2020
1 parent 965a07c commit 01d4ce2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions templates/mutable/bloc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:${appName}${relative}/index.dart';

class ${upperName}Bloc extends Bloc<${upperName}Event, ${upperName}State> {
// todo: check singleton for logic in project
// use GetIt for DI in projct
static final ${upperName}Bloc _${privateName}BlocSingleton = ${upperName}Bloc._internal();
factory ${upperName}Bloc() {
return _${privateName}BlocSingleton;
Expand Down
2 changes: 1 addition & 1 deletion templates/mutable/screen.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ${upperName}ScreenState extends State<${upperName}Screen> {
@override
Widget build(BuildContext context) {
return BlocBuilder<${upperName}Bloc, ${upperName}State>(
bloc: widget._${privateName}Bloc,
cubit: widget._${privateName}Bloc,
builder: (
BuildContext context,
${upperName}State currentState,
Expand Down
2 changes: 1 addition & 1 deletion templates/simple/screen.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ${upperName}ScreenState extends State<${upperName}Screen> {
@override
Widget build(BuildContext context) {
return BlocBuilder<${upperName}Bloc, ${upperName}State>(
bloc: widget._${privateName}Bloc,
cubit: widget._${privateName}Bloc,
builder: (
BuildContext context,
${upperName}State currentState,
Expand Down

0 comments on commit 01d4ce2

Please sign in to comment.