Skip to content

Commit 652d015

Browse files
committed
Merge branch 'test' of https://github.com/efoxTeam/flutter-ui into test
2 parents aa29b96 + dc82c19 commit 652d015

File tree

9 files changed

+193
-1
lines changed

9 files changed

+193
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
## **AppBar**
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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 :页面的抽屉,有从左向右或者从右向左的显示效果

lib/widget/index.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import 'scrollview/index.dart' as scrollview;
22
import 'regular/index.dart' as regular;
3-
3+
import 'navigator/index.dart' as navigator;
44
List getAllWidgets() {
55
List routerMap =[];
66
routerMap.addAll(scrollview.widgetMap);
77
routerMap.addAll(regular.widgetMap);
8+
routerMap.addAll(navigator.widgetMap);
89
return routerMap;
910
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
}

lib/widget/navigator/index.dart

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import 'package:efox_flutter/store/objects/widget_info.dart';
2+
import 'appbar/index.dart' as appbar;
3+
import 'scaffold/index.dart' as scaffold;
4+
const nameSpaces = '/navigator_';
5+
6+
List widgets = [
7+
ItemInfo(
8+
widget: scaffold.Index(),
9+
code: 57439, // playlist_play
10+
title: scaffold.Index.title,
11+
),
12+
ItemInfo(
13+
widget: appbar.Index(),
14+
code: 58729, // near_me
15+
title: appbar.Index.title,
16+
),
17+
];
18+
19+
List widgetMap = [
20+
ItemListInfo(
21+
nameSpaces: nameSpaces,
22+
widgetList: widgets,
23+
typeName: 'navigator',
24+
code: 58717,
25+
)
26+
];
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
int _count = 0 ;
10+
@override
11+
Widget build(BuildContext context) {
12+
return Scaffold(
13+
appBar: AppBar(
14+
title: Text('Sample Code'),
15+
),
16+
body: Center(
17+
child: Text('You have pressed the button $_count times.'),
18+
),
19+
bottomNavigationBar: BottomAppBar(
20+
child: Container(height: 50.0,),
21+
),
22+
bottomSheet: Text( 'bottomSheet123123'),
23+
floatingActionButton: FloatingActionButton(
24+
onPressed: () => setState(() {
25+
_count++;
26+
}),
27+
tooltip: 'Increment Counter',
28+
child: Icon(Icons.add),
29+
),
30+
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
31+
);
32+
}
33+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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 = 'Scaffold';
7+
static String originCodeUrl = 'https://docs.flutter.io/flutter/material/Scaffold-class.html';
8+
static String mdUrl = 'docs/widget/navigator/scaffold/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+
}

pubspec.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ flutter:
7070
- docs/widget/regular/table/
7171
- docs/widget/regular/flow/
7272
- docs/widget/regular/stack/
73+
- docs/widget/navigator/appbar/
74+
- docs/widget/navigator/scaffold/
7375
# An image asset can refer to one or more resolution-specific "variants", see
7476
# https://flutter.io/assets-and-images/#resolution-aware.
7577

0 commit comments

Comments
 (0)