File tree Expand file tree Collapse file tree 19 files changed +366
-30
lines changed Expand file tree Collapse file tree 19 files changed +366
-30
lines changed Original file line number Diff line number Diff line change 1+ ## ** AppBar**
Original file line number Diff line number Diff line change 1+ ## ** Scallold**
2+ >
3+ 页面的基础布局结构控件,
4+
5+ ### 构造方法
6+ ``` dart
7+ Scaffold({
8+ Key key,
9+ PreferredSizeWidget appBar,
10+ Widget body,
11+ Widget floatingActionButton,
12+ FloatingActionButtonLocation floatingActionButtonLocation,
13+ FloatingActionButtonAnimator floatingActionButtonAnimator,
14+ List<Widget> persistentFooterButtons,
15+ Widget drawer,
16+ Widget endDrawer,
17+ Widget bottomNavigationBar,
18+ Widget bottomSheet,
19+ Color backgroundColor,
20+ bool resizeToAvoidBottomPadding,
21+ bool resizeToAvoidBottomInset,
22+ bool primary: true,
23+ DragStartBehavior drawerDragStartBehavior: DragStartBehavior.down })
24+ ```
25+
26+ ### 属性介绍
27+ * appBar: 头部导航条
28+ * backgroundColor: 页面背景颜色
29+ * body : 整个scaffold主要显示模块内容
30+ * bottomNavigationBar:页面地方导航条
31+ * bottomSheet: 持久可见的底部sheet,即使用户在和其他页面部分有交互,底部sheet依然是可见的。
32+ 可以使用showBottomSheet函数创建和显示模态底部sheet。如果用ShowBottomSheet这个函数
33+ 创建了bottomSheet,那么在build一个含有bottomSheet的新的Scaffold的时候,当前的bottomSheet必须关闭。bottomSheet可以是任何形式的widget
34+ * drawer :页面的抽屉,有从左向右或者从右向左的显示效果
Original file line number Diff line number Diff line change 1+ ## ** GridView**
2+
3+ >
4+ Scrollable是一个可滚动的组件,ListView、GridView都会间接使用到该组件。
5+
6+ ### 构造方法
7+ ```
8+ Scrollable({
9+ Key key,
10+ AxisDirection axisDirection: AxisDirection.down,
11+ ScrollController controller,
12+ ScrollPhysics physics,
13+ @required ViewportBuilder viewportBuilder,
14+ bool excludeFromSemantics: false,
15+ int semanticChildCount,
16+ DragStartBehavior dragStartBehavior: DragStartBehavior.down
17+ })
18+ ```
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -2,19 +2,22 @@ import 'package:flutter/material.dart';
22
33class Index extends StatelessWidget {
44 final dynamic model;
5- Index ({Key key, this .model}): super (key: key);
5+ Index ({Key key, this .model}) : super (key: key);
66
77 @override
8- Widget build (BuildContext context) {
8+ Widget build (BuildContext context) {
99 return Container (
10- child: Center (
11- child: RaisedButton (
12- child: Text ('当前为${model .config .state .isPro ? '线上' : '线下' }环境,点击进行切换' ),
13- onPressed: () {
14- model.dispatch ('config' , 'setEnv' );
15- },
16- ),
10+ child: Row (
11+ children: [
12+ RaisedButton (
13+ child:
14+ Text ('当前为${model .config .state .isPro ? '线上' : '线下' }环境,点击进行切换' ),
15+ onPressed: () {
16+ model.dispatch ('config' , 'setEnv' );
17+ },
18+ ),
19+ ],
1720 ),
1821 );
1922 }
20- }
23+ }
Original file line number Diff line number Diff line change 11import 'package:scoped_model/scoped_model.dart' ;
22import 'user_model.dart' show UserModel;
3- import 'theme_model.dart' show AppThemeModel;
43import 'config_state_model.dart' show ConfigModel;
54
65/**
@@ -12,7 +11,7 @@ import 'config_state_model.dart' show ConfigModel;
1211 */
1312
1413///主数据模型,需要全局使用的数据在这里添加模型
15- class MainStateModel extends Model with UserModel , AppThemeModel {
14+ class MainStateModel extends Model with UserModel {
1615 Map <String , dynamic > state = {};
1716 ConfigModel config = ConfigModel ();
1817
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import 'scrollview/index.dart' as scrollview;
22import 'regular/index.dart' as regular;
3-
3+ import 'navigator/index.dart' as navigator;
44List getAllWidgets () {
55 List routerMap = [];
66 routerMap.addAll (scrollview.widgetMap);
77 routerMap.addAll (regular.widgetMap);
8+ routerMap.addAll (navigator.widgetMap);
89 return routerMap;
910}
Original file line number Diff line number Diff line change 1+ import 'package:flutter/material.dart' ;
2+
3+ class Index extends StatefulWidget {
4+ @override
5+ _IndexState createState () => _IndexState ();
6+ }
7+
8+ class _IndexState extends State <Index > {
9+ _airDress (){
10+ print ( '_airDress' );
11+ }
12+ _restitchDress (){
13+ print ( '_restitchDress' );
14+ }
15+ _repairDress (){
16+ print ( '_repairDress' );
17+ }
18+ @override
19+ Widget build (BuildContext context) {
20+ return Scaffold (
21+ appBar: AppBar (
22+ title: Text ('My Fancy Dress' ),
23+ actions: < Widget > [
24+ IconButton (
25+ icon: Icon (Icons .playlist_play),
26+ tooltip: 'Air it' ,
27+ onPressed: _airDress,
28+ ),
29+ IconButton (
30+ icon: Icon (Icons .playlist_add),
31+ tooltip: 'Restitch it' ,
32+ onPressed: _restitchDress,
33+ ),
34+ IconButton (
35+ icon: Icon (Icons .playlist_add_check),
36+ tooltip: 'Repair it' ,
37+ onPressed: _repairDress,
38+ ),
39+ ],
40+ )
41+ );
42+ }
43+ }
Original file line number Diff line number Diff line change 1+ import 'package:flutter/material.dart' ;
2+ import 'package:efox_flutter/components/widgetComp.dart' as WidgetComp;
3+ import 'demo.dart' as Demo;
4+
5+ class Index extends StatefulWidget {
6+ static String title = 'AppBar' ;
7+ static String originCodeUrl = 'https://docs.flutter.io/flutter/material/AppBar-class.html' ;
8+ static String mdUrl = 'docs/widget/navigator/appbar/index.md' ;
9+
10+ @override
11+ _IndexState createState () => _IndexState ();
12+ }
13+
14+ class _IndexState extends State <Index > {
15+ @override
16+ Widget build (BuildContext context) {
17+ return WidgetComp .Index (
18+ title: Index .title,
19+ originCodeUrl: Index .originCodeUrl,
20+ mdUrl: Index .mdUrl,
21+ demoChild: < Widget > [
22+ Demo .Index ()
23+ ],
24+ );
25+ }
26+ }
You can’t perform that action at this time.
0 commit comments