@@ -35,20 +35,38 @@ class Bind<T extends Object> extends BindContract<T> {
3535 }
3636
3737 ///Bind an already exist 'Instance' of object..
38- static Bind <T > instance <T extends Object >(T instance, {bool export = false , dynamic Function (T value)? selector}) {
39- return Bind <T >((i) => instance, isSingleton: false , isLazy: true , export: export, selector: selector);
38+ static Bind <T > instance <T extends Object >(T instance,
39+ {bool export = false , dynamic Function (T value)? selector}) {
40+ return Bind <T >((i) => instance,
41+ isSingleton: false , isLazy: true , export: export, selector: selector);
4042 }
4143
4244 ///Bind a 'Singleton' class.
4345 ///Built together with the module.
4446 ///The instance will always be the same.
45- static Bind <T > singleton <T extends Object >(T Function (Injector i) inject, {bool export = false , void Function (T value)? onDispose, dynamic Function (T value)? selector}) {
46- return Bind <T >(inject, isSingleton: true , isLazy: false , export: export, onDispose: onDispose, selector: selector);
47+ static Bind <T > singleton <T extends Object >(T Function (Injector i) inject,
48+ {bool export = false ,
49+ void Function (T value)? onDispose,
50+ dynamic Function (T value)? selector}) {
51+ return Bind <T >(inject,
52+ isSingleton: true ,
53+ isLazy: false ,
54+ export: export,
55+ onDispose: onDispose,
56+ selector: selector);
4757 }
4858
4959 ///Create single instance for request.
50- static Bind <T > lazySingleton <T extends Object >(T Function (Injector i) inject, {bool export = false , void Function (T value)? onDispose, dynamic Function (T value)? selector}) {
51- return Bind <T >(inject, isSingleton: true , isLazy: true , export: export, onDispose: onDispose, selector: selector);
60+ static Bind <T > lazySingleton <T extends Object >(T Function (Injector i) inject,
61+ {bool export = false ,
62+ void Function (T value)? onDispose,
63+ dynamic Function (T value)? selector}) {
64+ return Bind <T >(inject,
65+ isSingleton: true ,
66+ isLazy: true ,
67+ export: export,
68+ onDispose: onDispose,
69+ selector: selector);
5270 }
5371
5472 ///Bind a factory. Always a new constructor when calling Modular.get
@@ -82,7 +100,8 @@ class Bind<T extends Object> extends BindContract<T> {
82100}
83101
84102/// AsyncBind represents an asynchronous Bind that can be resolved before module initialization by calling Modular.isModuleReady() or called with Modular.getAsync()
85- class AsyncBind <T extends Object > extends Bind <Future <T >> implements AsyncBindContract <T > {
103+ class AsyncBind <T extends Object > extends Bind <Future <T >>
104+ implements AsyncBindContract <T > {
86105 @override
87106 final Future <T > Function (Injector i) asyncInject;
88107
@@ -104,7 +123,8 @@ class AsyncBind<T extends Object> extends Bind<Future<T>> implements AsyncBindCo
104123 @override
105124 Future <BindContract <T >> convertToBind () async {
106125 final bindValue = await resolveAsyncBind ();
107- return Bind <T >((i) => bindValue, export: export, alwaysSerialized: true , onDispose: _localOnDispose);
126+ return Bind <T >((i) => bindValue,
127+ export: export, alwaysSerialized: true , onDispose: _localOnDispose);
108128 }
109129
110130 @override
0 commit comments