@@ -5,7 +5,7 @@ import 'package:provider/provider.dart';
55import 'package:provider/single_child_widget.dart' ;
66
77/// {@template bloc_provider}
8- /// Takes a [Create] function that is responsible for
8+ /// Takes a `create` function that is responsible for
99/// creating the [Bloc] or [Cubit] and a [child] which will have access
1010/// to the instance via `BlocProvider.of(context)` .
1111/// It is used as a dependency injection (DI) widget so that a single instance
@@ -19,7 +19,7 @@ import 'package:provider/single_child_widget.dart';
1919/// ```
2020///
2121/// It automatically handles closing the instance when used with [Create] .
22- /// By default, [Create] is called only when the instance is accessed.
22+ /// By default, `create` is called only when the instance is accessed.
2323/// To override this behavior, set [lazy] to `false` .
2424///
2525/// ```dart
@@ -35,7 +35,7 @@ class BlocProvider<T extends StateStreamableSource<Object?>>
3535 extends SingleChildStatelessWidget {
3636 /// {@macro bloc_provider}
3737 const BlocProvider ({
38- required Create < T > create,
38+ required T Function ( BuildContext context) create,
3939 Key ? key,
4040 this .child,
4141 this .lazy = true ,
@@ -52,7 +52,7 @@ class BlocProvider<T extends StateStreamableSource<Object?>>
5252 ///
5353 /// A new [Bloc] or [Cubit] should not be created in `BlocProvider.value` .
5454 /// New instances should always be created using the
55- /// default constructor within the [Create] function.
55+ /// default constructor within the `create` function.
5656 ///
5757 /// ```dart
5858 /// BlocProvider.value(
@@ -76,7 +76,7 @@ class BlocProvider<T extends StateStreamableSource<Object?>>
7676 /// Defaults to `true` .
7777 final bool lazy;
7878
79- final Create < T > ? _create;
79+ final T Function ( BuildContext context) ? _create;
8080
8181 final T ? _value;
8282
0 commit comments