10
10
* [ provide] ( https://pub.dartlang.org/packages/provide )
11
11
* [ scoped_model] ( https://pub.dartlang.org/flutter/packages?q=scoped_model )
12
12
13
- #### 基本使用provide
14
- * 初始化
13
+ #### 初始化
15
14
```
16
- ///
15
+ /// UserModel
17
16
class UserModel with ChangeNotifier {
18
17
String name = 'Wanwu';
19
18
setAge(val) {
@@ -50,7 +49,7 @@ init({child, dispose = true}) {
50
49
/// main
51
50
void main() => runApp(init(child: MainApp()));
52
51
```
53
- * 分析ProvideMulti
52
+ #### 分析ProvideMulti
54
53
```
55
54
ProvideMulti(
56
55
builder: builder,
@@ -63,7 +62,7 @@ builder: (context, child, model)返回context, child, ProvidedValues值,P
63
62
requestedValues: [ ] 数组类型,即传入数据模型对应的namespace,需要使用哪个就传入哪个。[ UserModel, ConfigModel]
64
63
child: 传入组件,在build中返回
65
64
66
- * 使用
65
+ #### 使用
67
66
```
68
67
ProvideMulti(
69
68
builder:(context, child, model) {
@@ -78,6 +77,5 @@ ProvideMulti(
78
77
)
79
78
```
80
79
81
- 可在项目中进行尝试与使用ProvideMulti。
82
- 源码可参考[ flutter-ui中关于flutter_provide应用] ( https://github.com/efoxTeam/flutter-demo/tree/master/flutter_provide )
83
- 欢迎交流~
80
+ * 源码可参考[ flutter-ui中关于flutter_provide应用] ( https://github.com/efoxTeam/flutter-demo/tree/master/flutter_provide )
81
+ * 欢迎交流~
0 commit comments