Skip to content

Commit

Permalink
added export in asyncBind
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobaraujo7 committed Apr 30, 2021
1 parent 62a782e commit ad193e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions flutter_modular/lib/src/core/models/bind.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ class BindEmpty extends Bind<Object> {
class AsyncBind<T extends Object> extends Bind<Future<T>> {
final Future<T> Function(Inject i) asyncInject;

AsyncBind(this.asyncInject) : super(asyncInject);
///export bind for others modules
final bool export;

AsyncBind(this.asyncInject, {this.export = false}) : super(asyncInject, export: export);

Future<T> resolveAsyncBind() async {
final bind = await asyncInject(Inject());
Expand All @@ -73,6 +76,6 @@ class AsyncBind<T extends Object> extends Bind<Future<T>> {

Future<Bind<T>> converToAsyncBind() async {
final bindValue = await resolveAsyncBind();
return Bind<T>((i) => bindValue);
return Bind<T>((i) => bindValue, export: export);
}
}
2 changes: 1 addition & 1 deletion flutter_modular/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_modular
description: Smart project structure with dependency injection and route management
version: 3.1.1
version: 3.2.0
homepage: https://github.com/Flutterando/modular

environment:
Expand Down

0 comments on commit ad193e3

Please sign in to comment.