Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/widget/navigator/appbar/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## **AppBar**
34 changes: 34 additions & 0 deletions docs/widget/navigator/scaffold/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## **Scallold**
>
页面的基础布局结构控件,

### 构造方法
``` dart
Scaffold({
Key key,
PreferredSizeWidget appBar,
Widget body,
Widget floatingActionButton,
FloatingActionButtonLocation floatingActionButtonLocation,
FloatingActionButtonAnimator floatingActionButtonAnimator,
List<Widget> persistentFooterButtons,
Widget drawer,
Widget endDrawer,
Widget bottomNavigationBar,
Widget bottomSheet,
Color backgroundColor,
bool resizeToAvoidBottomPadding,
bool resizeToAvoidBottomInset,
bool primary: true,
DragStartBehavior drawerDragStartBehavior: DragStartBehavior.down })
```

### 属性介绍
* appBar: 头部导航条
* backgroundColor: 页面背景颜色
* body : 整个scaffold主要显示模块内容
* bottomNavigationBar:页面地方导航条
* bottomSheet: 持久可见的底部sheet,即使用户在和其他页面部分有交互,底部sheet依然是可见的。
可以使用showBottomSheet函数创建和显示模态底部sheet。如果用ShowBottomSheet这个函数
创建了bottomSheet,那么在build一个含有bottomSheet的新的Scaffold的时候,当前的bottomSheet必须关闭。bottomSheet可以是任何形式的widget
* drawer :页面的抽屉,有从左向右或者从右向左的显示效果
3 changes: 2 additions & 1 deletion lib/widget/index.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import 'scrollview/index.dart' as scrollview;
import 'regular/index.dart' as regular;

import 'navigator/index.dart' as navigator;
List getAllWidgets() {
List routerMap =[];
routerMap.addAll(scrollview.widgetMap);
routerMap.addAll(regular.widgetMap);
routerMap.addAll(navigator.widgetMap);
return routerMap;
}
43 changes: 43 additions & 0 deletions lib/widget/navigator/appbar/demo.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import 'package:flutter/material.dart';

class Index extends StatefulWidget {
@override
_IndexState createState() => _IndexState();
}

class _IndexState extends State<Index> {
_airDress (){
print( '_airDress');
}
_restitchDress (){
print( '_restitchDress');
}
_repairDress (){
print( '_repairDress');
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('My Fancy Dress'),
actions: <Widget>[
IconButton(
icon: Icon(Icons.playlist_play),
tooltip: 'Air it',
onPressed: _airDress,
),
IconButton(
icon: Icon(Icons.playlist_add),
tooltip: 'Restitch it',
onPressed: _restitchDress,
),
IconButton(
icon: Icon(Icons.playlist_add_check),
tooltip: 'Repair it',
onPressed: _repairDress,
),
],
)
);
}
}
26 changes: 26 additions & 0 deletions lib/widget/navigator/appbar/index.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import 'package:flutter/material.dart';
import 'package:efox_flutter/components/widgetComp.dart' as WidgetComp;
import 'demo.dart' as Demo;

class Index extends StatefulWidget {
static String title = 'AppBar';
static String originCodeUrl = 'https://docs.flutter.io/flutter/material/AppBar-class.html';
static String mdUrl = 'docs/widget/navigator/appbar/index.md';

@override
_IndexState createState() => _IndexState();
}

class _IndexState extends State<Index> {
@override
Widget build(BuildContext context) {
return WidgetComp.Index(
title: Index.title,
originCodeUrl: Index.originCodeUrl,
mdUrl: Index.mdUrl,
demoChild: <Widget>[
Demo.Index()
],
);
}
}
26 changes: 26 additions & 0 deletions lib/widget/navigator/index.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import 'package:efox_flutter/store/objects/widget_info.dart';
import 'appbar/index.dart' as appbar;
import 'scaffold/index.dart' as scaffold;
const nameSpaces = '/navigator_';

List widgets = [
ItemInfo(
widget: scaffold.Index(),
code: 57439, // playlist_play
title: scaffold.Index.title,
),
ItemInfo(
widget: appbar.Index(),
code: 58729, // near_me
title: appbar.Index.title,
),
];

List widgetMap = [
ItemListInfo(
nameSpaces: nameSpaces,
widgetList: widgets,
typeName: 'navigator',
code: 58717,
)
];
33 changes: 33 additions & 0 deletions lib/widget/navigator/scaffold/demo.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import 'package:flutter/material.dart';

class Index extends StatefulWidget {
@override
_IndexState createState() => _IndexState();
}

class _IndexState extends State<Index> {
int _count = 0 ;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Sample Code'),
),
body: Center(
child: Text('You have pressed the button $_count times.'),
),
bottomNavigationBar: BottomAppBar(
child: Container(height: 50.0,),
),
bottomSheet: Text( 'bottomSheet123123'),
floatingActionButton: FloatingActionButton(
onPressed: () => setState(() {
_count++;
}),
tooltip: 'Increment Counter',
child: Icon(Icons.add),
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
);
}
}
26 changes: 26 additions & 0 deletions lib/widget/navigator/scaffold/index.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import 'package:flutter/material.dart';
import 'package:efox_flutter/components/widgetComp.dart' as WidgetComp;
import 'demo.dart' as Demo;

class Index extends StatefulWidget {
static String title = 'Scaffold';
static String originCodeUrl = 'https://docs.flutter.io/flutter/material/Scaffold-class.html';
static String mdUrl = 'docs/widget/navigator/scaffold/index.md';

@override
_IndexState createState() => _IndexState();
}

class _IndexState extends State<Index> {
@override
Widget build(BuildContext context) {
return WidgetComp.Index(
title: Index.title,
originCodeUrl: Index.originCodeUrl,
mdUrl: Index.mdUrl,
demoChild: <Widget>[
Demo.Index()
],
);
}
}
2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ flutter:
- docs/widget/regular/table/
- docs/widget/regular/flow/
- docs/widget/regular/stack/
- docs/widget/navigator/appbar/
- docs/widget/navigator/scaffold/
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.io/assets-and-images/#resolution-aware.

Expand Down