Merge branch 'develop' into dev/yisheng

# Conflicts:
#	lib/widgets/components/Bar/AppBar/index.dart
#	lib/widgets/components/Bar/BottomAppBar/demo.dart
#	lib/widgets/components/Bar/BottomAppBar/index.dart
#	lib/widgets/components/Bar/ButtonBar/index.dart
#	lib/widgets/components/Bar/FlexibleSpaceBar/index.dart
#	lib/widgets/components/Bar/SliverAppBar/index.dart
#	lib/widgets/components/Bar/SnackBar/index.dart
#	lib/widgets/components/Bar/SnackBarAction/index.dart
#	lib/widgets/components/Card/Card/index.dart
#	lib/widgets/components/LIst/ListBody/index.dart
#	lib/widgets/components/LIst/ListView/index.dart
#	lib/widgets/elements/Form/Button/DropdownButton/index.dart
#	lib/widgets/elements/Form/Button/FlatButton/index.dart
#	lib/widgets/elements/Form/Button/PopupMenuButton/index.dart
#	lib/widgets/elements/Form/CheckBox/Checkbox/index.dart
#	lib/widgets/elements/Form/CheckBox/CheckboxListTile/index.dart
#	lib/widgets/elements/Frame/Axis/crossAxis/index.dart
#	lib/widgets/elements/Frame/Axis/flipAxis/index.dart
#	lib/widgets/elements/Frame/Axis/mainAxis/index.dart
#	lib/widgets/elements/Media/Image/precacheImage/index.dart
This commit is contained in:
ryan730
2019-01-12 17:30:11 +08:00
130 changed files with 613 additions and 692 deletions

View File

@ -7,7 +7,6 @@
* tartget: AppBar 的示例
*/
import 'dart:math';
import 'package:flutter/material.dart';
/*

View File

@ -7,7 +7,7 @@
* tartget: AppBar 的示例
*/
import '../../../../common/widget_demo.dart';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
@ -48,18 +48,18 @@ class _DemoState extends State<Demo> {
return WidgetDemo(
title: 'AppBar',
codeUrl: 'componentss/Bar/AppBar/demo.dart',
contentList: [ allDemoBoxs(context, this) ],
contentList: [allCheckboxs(context, this)],
docUrl: 'https://docs.flutter.io/flutter/material/AppBar-class.html',
);
}
}
/**
/*
* 所有的 AppBar widget
* context: 运行上下文
* that: 指向有状态的 StatefulWidget
*/
Widget allDemoBoxs(BuildContext context, _DemoState that) {
Widget allCheckboxs(BuildContext context, _DemoState that) {
return Container(
//padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0),
child: Column(

View File

@ -6,6 +6,7 @@
* email: zhu.yan@alibaba-inc.com
* tartget: BottomAppBar 的示例
*/
import 'package:flutter/material.dart';
/*

View File

@ -7,6 +7,7 @@
* tartget: BottomAppBar 的示例
*/
import '../../../../common/widget_demo.dart';
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
@ -24,11 +25,6 @@ const String _Text1 =
> 通常与Scaffold和FloatingActionButton一起使用。
""";
const String _Text2 =
"""### **进阶用法**
> BottomAppBar
-
""";
class Demo extends StatefulWidget {
static const String routeName = '/components//Bar/BottomAppBar';
@ -43,18 +39,18 @@ class _DemoState extends State<Demo> {
return WidgetDemo(
title: 'BottomAppBar',
codeUrl: 'componentss/Bar/BottomAppBar/demo.dart',
contentList: [allDomeBoxs(context, this)],
contentList: [allCheckboxs(context, this)],
docUrl: 'https://docs.flutter.io/flutter/material/BottomAppBar-class.html',
);
}
}
/**
/*
* 所有的 BottomAppBar widget
* context: 运行上下文
* that: 指向有状态的 StatefulWidget
*/
Widget allDomeBoxs(BuildContext context, _DemoState that) {
Widget allCheckboxs(BuildContext context, _DemoState that) {
return Container(
//padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0),
child: Column(

View File

@ -7,7 +7,6 @@
* tartget: ButtonBar 的示例
*/
import 'dart:math';
import 'package:flutter/material.dart';
/*

View File

@ -7,7 +7,7 @@
* tartget: ButtonBar 的示例
*/
import '../../../../common/widget_demo.dart';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
@ -26,11 +26,6 @@ const String _Text1 =
- 当Directionality为TextDirection.ltr时按钮栏的子项右对齐最后一个子项成为最右边的子项。当Directionality TextDirection.rtl时子项被左对齐最后一个子项成为最左边的子项。
""";
const String _Text2 =
"""### **进阶用法**
> ButtonBar
-
""";
class Demo extends StatefulWidget {
static const String routeName = '/components/Bar/ButtonBar';
@ -44,19 +39,19 @@ class _DemoState extends State<Demo> {
Widget build(BuildContext context) {
return WidgetDemo(
title: 'ButtonBar',
codeUrl: 'componentss//Bar/ButtonBar/demo.dart',
contentList: [allDemoBoxs(context, this)],
codeUrl: 'components/Bar/ButtonBar/demo.dart',
contentList: [allCheckboxs(context, this)],
docUrl: 'https://docs.flutter.io/flutter/material/ButtonBar-class.html',
);
}
}
/**
/*
* 所有的 ButtonBar widget
* context: 运行上下文
* that: 指向有状态的 StatefulWidget
*/
Widget allDemoBoxs(BuildContext context, _DemoState that) {
Widget allCheckboxs(BuildContext context, _DemoState that) {
return Container(
//padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0),
child: Column(

View File

@ -7,7 +7,7 @@
* tartget: FlexibleSpaceBar 的示例
*/
import 'dart:math';
import 'package:flutter/material.dart';
/*

View File

@ -7,7 +7,7 @@
* tartget: FlexibleSpaceBar 的示例
*/
import '../../../../common/widget_demo.dart';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
@ -27,11 +27,6 @@ const String _Text1 =
- 要调整 AppBar 大小,必须将其包装在 FlexibleSpaceBar.createSettings 返回的 widget 中 ,以将大小调整信息传递给 FlexibleSpaceBar。
""";
const String _Text2 =
"""### **进阶用法**
> FlexibleSpaceBar
-
""";
class Demo extends StatefulWidget {
static const String routeName = '/components//Bar/FlexibleSpaceBar';
@ -45,19 +40,19 @@ class _DemoState extends State<Demo> {
Widget build(BuildContext context) {
return WidgetDemo(
title: 'FlexibleSpaceBar',
codeUrl: 'Bar/FlexibleSpaceBar/demo.dart',
contentList: [allDemoBoxs(context, this)],
codeUrl: 'components/Bar/FlexibleSpaceBar/demo.dart',
contentList: [allCheckboxs(context, this)],
docUrl: 'https://docs.flutter.io/flutter/material/FlexibleSpaceBar-class.html',
);
}
}
/**
/*
* 所有的 FlexibleSpaceBar widget
* context: 运行上下文
* that: 指向有状态的 StatefulWidget
*/
Widget allDemoBoxs(BuildContext context, _DemoState that) {
Widget allCheckboxs(BuildContext context, _DemoState that) {
return Container(
//padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0),
child: Column(

View File

@ -7,7 +7,6 @@
* tartget: SliverAppBar 的示例
*/
import 'dart:math';
import 'package:flutter/material.dart';
/*

View File

@ -7,7 +7,7 @@
* tartget: SliverAppBar 的示例
*/
import '../../../../common/widget_demo.dart';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
@ -41,18 +41,18 @@ class _DemoState extends State<Demo> {
return WidgetDemo(
title: 'SliverAppBar',
codeUrl: 'componentss/Bar/SliverAppBar/demo.dart',
contentList: [allDemoBoxs(context, this)],
contentList:[allCheckboxs(context, this)],
docUrl: 'https://docs.flutter.io/flutter/widgets/SliverAppBar-class.html',
);
}
}
/**
/*
* 所有的 SliverAppBar widget
* context: 运行上下文
* that: 指向有状态的 StatefulWidget
*/
Widget allDemoBoxs(BuildContext context, _DemoState that) {
Widget allCheckboxs(BuildContext context, _DemoState that) {
return Container(
//padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0),
child: Column(

View File

@ -7,7 +7,7 @@
* tartget: SnackBar 的示例
*/
import 'dart:math';
import 'package:flutter/material.dart';
/*

View File

@ -7,7 +7,7 @@
* tartget: SnackBar 的示例
*/
import '../../../../common/widget_demo.dart';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
@ -27,11 +27,6 @@ const String _Text1 =
- 要控制SnackBar保持可见的时间请指定持续时间。
""";
const String _Text2 =
"""### **进阶用法**
> SnackBar
-
""";
class Demo extends StatefulWidget {
static const String routeName = '/components//Bar/SnackBar';
@ -46,18 +41,18 @@ class _DemoState extends State<Demo> {
return WidgetDemo(
title: 'SnackBar',
codeUrl: 'componentss/Bar/SnackBar/demo.dart',
contentList: [allDemoBoxs(context, this)],
contentList: [allCheckboxs(context, this)],
docUrl: 'https://docs.flutter.io/flutter/material/SnackBar-class.html',
);
}
}
/**
/*
* 所有的 SnackBar widget
* context: 运行上下文
* that: 指向有状态的 StatefulWidget
*/
Widget allDemoBoxs(BuildContext context, _DemoState that) {
Widget allCheckboxs(BuildContext context, _DemoState that) {
return Container(
//padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0),
child: Column(

View File

@ -7,10 +7,8 @@
* tartget: SnackBarAction 的示例
*/
import 'dart:math';
import 'dart:async';
import 'package:flutter/material.dart';
import 'demo.dart';
class SnackBarActionDemo extends StatefulWidget {
_Demo createState() => _Demo();

View File

@ -7,10 +7,7 @@
* tartget: SnackBarAction 的示例
*/
import '../../../../common/widget_demo.dart';
import 'dart:math';
import 'package:flutter/material.dart';
import '../../../../components/markdown.dart';
import './demo.dart' as SnackBarDemo;
const String _Text0 = """

View File

@ -7,7 +7,6 @@
* tartget: TabBar 的示例
*/
import 'dart:math';
import 'package:flutter/material.dart';
class TabBarDemo extends StatefulWidget {

View File

@ -7,8 +7,6 @@
* tartget: SnackBarAction 的示例
*/
import '../../../../common/widget_demo.dart';
import 'dart:math';
import 'package:flutter/material.dart';
import './demo.dart';

View File

@ -7,7 +7,6 @@
* tartget: Card 的示例
*/
import 'dart:math';
import 'package:flutter/material.dart';
/*

View File

@ -7,7 +7,7 @@
* tartget: Card 的示例
*/
import '../../../../common/widget_demo.dart';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
@ -25,11 +25,6 @@ const String _Text1 =
> 此示例显示了创建卡片窗口组件,其中显示了相册信息和两个操作
""";
const String _Text2 =
"""### **进阶用法**
> Card
-
""";
class Demo extends StatefulWidget {
static const String routeName = '/components/Card/Card';
@ -43,19 +38,19 @@ class _DemoState extends State<Demo> {
Widget build(BuildContext context) {
return WidgetDemo(
title: 'Card',
codeUrl: 'componentss/Card/Card/demo.dart',
contentList: [allDemoBoxs(context, this)],
codeUrl: 'components/Card/Card/demo.dart',
contentList: [allCheckboxs(context, this)],
docUrl: 'https://docs.flutter.io/flutter/material/Card-class.html',
);
}
}
/**
/*
* 所有的 Card widget
* context: 运行上下文
* that: 指向有状态的 StatefulWidget
*/
Widget allDemoBoxs(BuildContext context, _DemoState that) {
Widget allCheckboxs(BuildContext context, _DemoState that) {
return Container(
//padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0),
child: Column(

View File

@ -27,8 +27,7 @@ final List<InputEntry> _lists=<InputEntry>[
const InputEntry('web', 'W'),
];
List<String> _inputs=<String>[];
Iterable<Widget> get RawChipWidget sync*{
Iterable<Widget> get _rawChipWidget sync*{
for(InputEntry value in _lists){
yield Padding(
padding: const EdgeInsets.all(4.0),
@ -57,7 +56,7 @@ Iterable<Widget> get RawChipWidget sync*{
return Column(
children: <Widget>[
Wrap(
children: RawChipWidget.toList(),
children: _rawChipWidget.toList(),
),
],

View File

@ -7,8 +7,6 @@
* tartget: xxx
*/
import 'dart:math';
import 'dart:async';
import 'package:flutter/material.dart';

View File

@ -7,8 +7,6 @@
* tartget: xxx
*/
import 'dart:math';
import 'dart:async';
import 'package:flutter/material.dart';

View File

@ -7,8 +7,6 @@
* tartget: xxx
*/
import 'dart:math';
import 'dart:async';
import 'package:flutter/material.dart';
@ -72,7 +70,7 @@ class _DialogMoreDemo extends State<DialogMoreDemo> {
value += 1;
});
},
child: Text("我是一个Dialog, 点我更新value: ${value}"),
child: Text("我是一个Dialog, 点我更新value: $value"),
)
);
}
@ -105,3 +103,4 @@ class _DialogMoreDemo extends State<DialogMoreDemo> {
);
}
}

View File

@ -7,8 +7,6 @@
* tartget: xxx
*/
import 'dart:math';
import 'dart:async';
import 'package:flutter/material.dart';

View File

@ -7,8 +7,6 @@
* tartget: xxx
*/
import 'dart:math';
import 'dart:async';
import 'package:flutter/material.dart';

View File

@ -7,8 +7,6 @@
* tartget: xxx
*/
import 'dart:math';
import 'dart:async';
import 'package:flutter/material.dart';

View File

@ -7,8 +7,6 @@
* tartget: xxx
*/
import 'dart:math';
import 'dart:async';
import 'package:flutter/material.dart';

View File

@ -1,4 +1,4 @@
import 'dart:async';
import 'package:flutter/material.dart';
import './model.dart';

View File

@ -39,19 +39,19 @@ class Demo extends StatefulWidget {
}
class _DemoState extends State<Demo> {
var animatedList = null;
State animatedList;
@override
Widget build(BuildContext context) {
return WidgetDemo(
title: 'AnimatedList',
codeUrl: 'componentss/List/AnimatedList/demo.dart',
codeUrl: 'components/List/AnimatedList/demo.dart',
contentList: [allDemoBoxs(context, this)],
docUrl: 'https://docs.flutter.io/flutter/widgets/AnimatedList-class.html',
);
}
}
/**
/*
* 所有的 AnimatedList widget
* context: 运行上下文
* that: 指向有状态的 StatefulWidget

View File

@ -7,7 +7,6 @@
* tartget: ListBody 的示例
*/
import 'dart:math';
import 'package:flutter/material.dart';
/*

View File

@ -7,7 +7,7 @@
* tartget: ListBody 的示例
*/
import '../../../../common/widget_demo.dart';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
@ -41,19 +41,19 @@ class _DemoState extends State<Demo> {
Widget build(BuildContext context) {
return WidgetDemo(
title: 'ListBody',
codeUrl: 'componentss/List/ListBody/demo.dart',
contentList: [allDemoBoxs(context, this)],
codeUrl: 'components/List/ListBody/demo.dart',
contentList: [allCheckboxs(context, this)],
docUrl: 'https://docs.flutter.io/flutter/widgets/ListBody-class.html',
);
}
}
/**
/*
* 所有的 ListBody widget
* context: 运行上下文
* that: 指向有状态的 StatefulWidget
*/
Widget allDemoBoxs(BuildContext context, _DemoState that) {
Widget allCheckboxs(BuildContext context, _DemoState that) {
return Container(
//padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0),
child: Column(

View File

@ -7,7 +7,6 @@
* tartget: ListView 的示例
*/
import 'dart:math';
import 'package:flutter/material.dart';
/*
@ -86,8 +85,8 @@ class ListViewLessDefault extends StatelessWidget {
dense:true, // item 直观感受是整体大小
contentPadding: EdgeInsets.all(10.0),// item 内容内边距
enabled:true,
onTap:(){print('点击:${index}');},// item onTap 点击事件
onLongPress:(){print('长按:${index}');},// item onLongPress 长按事件
onTap:(){print('点击:$index');},// item onTap 点击事件
onLongPress:(){print('长按:$index');},// item onLongPress 长按事件
selected:false, // item 是否选中状态
);
},
@ -111,8 +110,8 @@ class ListViewLessDefault extends StatelessWidget {
dense:true, // item 直观感受是整体大小
contentPadding: EdgeInsets.all(10.0),// item 内容内边距
enabled:true,
onTap:(){print('点击:${index}');},// item onTap 点击事件
onLongPress:(){print('长按:${index}');},// item onLongPress 长按事件
onTap:(){print('点击:$index');},// item onTap 点击事件
onLongPress:(){print('长按:$index');},// item onLongPress 长按事件
selected:false, // item 是否选中状态
);
},

View File

@ -7,7 +7,6 @@
* tartget: ListView 的示例
*/
import '../../../../common/widget_demo.dart';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
@ -68,19 +67,19 @@ class _DemoState extends State<Demo> {
Widget build(BuildContext context) {
return WidgetDemo(
title: 'ListView',
codeUrl: 'componentss/List/ListView/demo.dart',
contentList: [allDemoBoxs(context, this)],
codeUrl: '/componentss/List/ListView/demo.dart',
contentList: [allCheckboxs(context, this)],
docUrl: 'https://docs.flutter.io/flutter/widgets/ListView-class.html',
);
}
}
/**
/*
* 所有的 ListView widget
* context: 运行上下文
* that: 指向有状态的 StatefulWidget
*/
Widget allDemoBoxs(BuildContext context, _DemoState that) {
Widget allCheckboxs(BuildContext context, _DemoState that) {
return Container(
//padding: new EdgeInsets.only(bottom: 20.0, top: 20.0, left: 0, right: 0),
child: Column(

View File

@ -13,7 +13,6 @@ class CheckedPopupMenuItemDemo extends StatefulWidget {
}
class _CheckedPopupMenuItemDemoState extends State<CheckedPopupMenuItemDemo> {
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
List<String> _checkedValues;
final String _checkedValue1 = 'One';

View File

@ -12,7 +12,6 @@ import './DropdownMenuItem/index.dart' as DropdownMenuItem;
import './PopupMenuButton/index.dart' as PopupMenuButton;
import './PopupMenuDivider/index.dart' as PopupMenuDivider;
import './PopupMenuEntry/index.dart' as PopupMenuEntry;
import './PopupMenuItem/index.dart' as PopupMenuItem;
import './PopupMenuItemState/index.dart' as PopupMenuItemState;

View File

@ -7,7 +7,6 @@
* tartget: BottomNavigationBar 的示例
*/
import 'dart:math';
import 'package:flutter/material.dart';
/*

View File

@ -6,7 +6,7 @@
* email: zhu.yan@alibaba-inc.com
* tartget: BottomNavigationBar 的示例
*/
import '../../../../routers/application.dart';
import 'package:flutter/material.dart';
import '../../../../common/widget_demo.dart';
@ -42,7 +42,7 @@ class _DemoState extends State<Demo> {
Widget build(BuildContext context) {
return WidgetDemo(
title: 'BottomNavigationBar',
codeUrl: '${Application.github['widgetsURL']}components/Navigation/BottomNavigationBar/demo.dart',
codeUrl: 'components/Navigation/BottomNavigationBar/demo.dart',
contentList: [allDemoBoxs(context, this)],
docUrl: 'https://docs.flutter.io/flutter/material/BottomNavigationBar-class.html',
bottomNaviBar:BottomNavigationBarDemo.BottomNavigationBarFullDefault()
@ -50,7 +50,7 @@ class _DemoState extends State<Demo> {
}
}
/**
/*
* 所有的 BottomNavigationBar widget
* context: 运行上下文
* that: 指向有状态的 StatefulWidget

View File

@ -7,7 +7,6 @@
* tartget: BottomNavigationBarItem 的示例
*/
import 'dart:math';
import 'package:flutter/material.dart';
/*

View File

@ -7,8 +7,7 @@
* tartget: BottomNavigationBarItem 的示例
*/
import '../../../../common/widget_demo.dart';
import '../../../../routers/application.dart';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
@ -26,11 +25,6 @@ const String _Text1 =
> 这个类很少单独使用。通常嵌入在上面的一个底部 bottom navigation widgets 中。
""";
const String _Text2 =
"""### **进阶用法**
> BottomNavigationBarItem
-
""";
class Demo extends StatefulWidget {
static const String routeName = '/components/Navigation/BottomNavigationBarItem';
@ -44,14 +38,14 @@ class _DemoState extends State<Demo> {
Widget build(BuildContext context) {
return WidgetDemo(
title: 'BottomNavigationBarItem',
codeUrl: '${Application.github['widgetsURL']}components/Bar/BottomNavigationBarItem/demo.dart',
codeUrl: 'components/Bar/BottomNavigationBarItem/demo.dart',
contentList: [allCheckboxs(context, this)],
docUrl: 'https://docs.flutter.io/flutter/widgets/BottomNavigationBarItem-class.html',
);
}
}
/**
/*
* 所有的 BottomNavigationBarItem widget
* context: 运行上下文
* that: 指向有状态的 StatefulWidget

View File

@ -15,7 +15,7 @@ enum Location {
typedef DemoItemBodyBuilder<T> = Widget Function(DemoItem<T> item);
typedef ValueToString<T> = String Function(T value);
/**
/*
* google flutter 详情多个例子地址:
* https://github.com/flutter/flutter/blob/master/examples/flutter_gallery/lib/demo/material/expansion_panels_demo.dart
*/
@ -135,11 +135,6 @@ class _ExpansionPanelsDemoState extends State<ExpansionPanelsDemo> {
hint: 'Select location',
valueToString: (Location location) => location.toString().split('.')[1],
builder: (DemoItem<Location> item) {
void close() {
setState(() {
item.isExpanded = false;
});
}
return Form(
child: Builder(
builder: (BuildContext context) {

View File

@ -1,8 +1,8 @@
/*
* @Author: xiaojia.dxj
* @Date: 2018-12-17 15:37:32
* @Last Modified by: xiaojia.dxj
* @Last Modified time: 2018-12-18 19:12:32
* @Last Modified by: 一凨
* @Last Modified time: 2019-01-11 15:17:26
*/
import 'dart:async';

View File

@ -6,7 +6,6 @@
*/
import 'package:flutter/material.dart';
import '../../../../common/widget_demo.dart';
import 'demo.dart';
const String content0 = '''
### **简介**

View File

@ -5,7 +5,6 @@
* @Last Modified time: 2018-12-15 21:26:11
*/
import 'package:flutter/material.dart';
import 'package:flutter/material.dart';
import '../../../../common/widget_demo.dart';
import './demo.dart';

View File

@ -6,7 +6,6 @@
* email: zhu.yan@alibaba-inc.com
* tartget: DropdownButton 的示例
*/
import 'dart:math';
import 'package:flutter/material.dart';
/*
@ -14,15 +13,15 @@ import 'package:flutter/material.dart';
* isDisabled:是否是禁用isDisabled 默认为true
* */
class DropdownButtonDefault extends StatelessWidget {
List<DropdownMenuItem> generateItemList() {
List<DropdownMenuItem> items = new List();
DropdownMenuItem item1 = new DropdownMenuItem(
List<DropdownMenuItem> generateItemList() {
final List<DropdownMenuItem> items = new List();
final DropdownMenuItem item1 = new DropdownMenuItem(
value: '张三', child: new Text('张三'));
DropdownMenuItem item2 = new DropdownMenuItem(
final DropdownMenuItem item2 = new DropdownMenuItem(
value: '李四', child: new Text('李四'));
DropdownMenuItem item3 = new DropdownMenuItem(
final DropdownMenuItem item3 = new DropdownMenuItem(
value: '王二', child: new Text('王二'));
DropdownMenuItem item4 = new DropdownMenuItem(
final DropdownMenuItem item4 = new DropdownMenuItem(
value: '麻子', child: new Text('麻子'));
items.add(item1);
items.add(item2);

View File

@ -8,6 +8,7 @@
* 对应文档地址:https://docs.flutter.io/flutter/material/DropdownButton-class.html
*/
import '../../../../../common/widget_demo.dart';
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
@ -56,7 +57,7 @@ class _DemoState extends State<Demo> {
}
}
/**
/*
* 所有的 DropdownButton 按钮
*/
Widget allDropdownButtons(BuildContext context,_DemoState that){

View File

@ -16,7 +16,7 @@ import 'package:flutter/material.dart';
class FlatButtonDefault extends StatelessWidget {
final bool isDisabled;
const FlatButtonDefault([bool this.isDisabled = true])
const FlatButtonDefault([ this.isDisabled = true])
: assert(isDisabled != null),
super();
@ -39,7 +39,7 @@ class FlatButtonIconDefault extends StatelessWidget {
final IconData icon;
const FlatButtonIconDefault(
[bool this.isDisabled = true, IconData this.icon = Icons.add_circle])
[ this.isDisabled = true, this.icon = Icons.add_circle])
: super();
Color _randomColor() {
@ -73,10 +73,10 @@ class FlatButtonCustom extends StatelessWidget {
final VoidCallback onPressed;
const FlatButtonCustom([
String this.txt = '自定义按钮',
Color this.color = Colors.blueAccent,
ShapeBorder this.shape,
VoidCallback this.onPressed
this.txt = '自定义按钮',
this.color = Colors.blueAccent,
this.shape,
this.onPressed
]) :super();
@override

View File

@ -8,39 +8,12 @@
* 对应文档地址:https://docs.flutter.io/flutter/material/FlatButton-class.html
*/
import '../../../../../common/widget_demo.dart';
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import './demo.dart' as flatButton;
const String _markdownData = """# Markdown Example
Markdown allows you to easily include formatted text, images, and even formatted Dart code in your app.
## Styling
Style text as _italic_, __bold__, or `inline code`.
- Use bulleted lists
- To better clarify
- Your points
## Links
You can use [hyperlinks](hyperlink) in markdown
## Images
You can include images:
![Flutter logo](https://flutter.io/images/flutter-mark-square-100.png#100x100)
## Markdown widget
This is an example of how to create your own Markdown widget:
new Markdown(data: 'Hello _world_!');
## Code blocks
Formatted Dart code looks really pretty too:
```
void main() {
runApp(new MaterialApp(
home: new Scaffold(
body: new Markdown(data: markdownData)
)
));
}
```
Enjoy!
""";
const String _flatText0 =
@ -88,7 +61,7 @@ class _DemoState extends State<Demo> {
}
}
/**
/*
* 所有的 FlatButton 按钮
*/
Widget allFlatButtons(BuildContext context){

View File

@ -6,7 +6,6 @@
* email: zhu.yan@alibaba-inc.com
* tartget: OutlineButton 的示例
*/
import 'dart:math';
import 'package:flutter/material.dart';
/*
@ -16,7 +15,7 @@ import 'package:flutter/material.dart';
class FloatingActionButtonDefault extends StatelessWidget {
final bool isDisabled;
const FloatingActionButtonDefault([bool this.isDisabled = true])
const FloatingActionButtonDefault([ this.isDisabled = true])
: assert(isDisabled != null),
super();
@ -41,10 +40,10 @@ class FloatingActionButtonCustom extends StatelessWidget {
final VoidCallback onPressed;
const FloatingActionButtonCustom(
[String this.txt = '自定义按钮',
Color this.color = Colors.orange,
ShapeBorder this.shape,
VoidCallback this.onPressed])
[ this.txt = '自定义按钮',
this.color = Colors.orange,
this.shape,
this.onPressed])
: super();
@override
@ -93,10 +92,10 @@ class FloatingActionButtonCustom2 extends StatelessWidget {
final VoidCallback onPressed;
const FloatingActionButtonCustom2(
[String this.txt = '自定义按钮',
Color this.color = Colors.orange,
ShapeBorder this.shape,
VoidCallback this.onPressed])
[ this.txt = '自定义按钮',
this.color = Colors.orange,
this.shape,
this.onPressed])
: super();
@override

View File

@ -14,8 +14,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import './demo.dart' as floatingActionButton;
const String _floatingActionTitle =
'FloatingAction Button 示例';
const String _floatingActionText0 =
"""### **简介**
@ -68,7 +66,7 @@ class _DemoState extends State<Demo> {
}
}
/**
/*
* 所有的 FloatingActionButton 按钮
*/
Widget allFloatingActionButtons(BuildContext context,_DemoState that){
@ -105,26 +103,26 @@ Widget allFloatingActionButtons(BuildContext context,_DemoState that){
* alert 弹框
* context:容器的父级
* */
void _showMessage(String name, BuildContext context) {
showDialog(
// alert 的父级
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text('提示'),
content: new Text(name),
actions: <Widget>[
new FlatButton(
// alert 的取消按钮
onPressed: () {
// 取消的事件
Navigator.of(context).pop(true);
},
child: new Text('取消'))
]);
}
);
}
// void _showMessage(String name, BuildContext context) {
// showDialog(
// // alert 的父级
// context: context,
// builder: (BuildContext context) {
// return AlertDialog(
// title: new Text('提示'),
// content: new Text(name),
// actions: <Widget>[
// new FlatButton(
// // alert 的取消按钮
// onPressed: () {
// // 取消的事件
// Navigator.of(context).pop(true);
// },
// child: new Text('取消'))
// ]);
// }
// );
// }
/*
* 带align的text

View File

@ -19,7 +19,7 @@ final int len = IconNames.Names.length;
class IconButtonDefault extends StatelessWidget {
final bool isDisabled;
const IconButtonDefault([bool this.isDisabled = true])
const IconButtonDefault([ this.isDisabled = true])
: assert(isDisabled != null),
super();
@ -43,10 +43,10 @@ class IconButtonCustom extends StatelessWidget {
final VoidCallback onPressed;
const IconButtonCustom(
[String this.txt = '自定义按钮',
Color this.color = Colors.blueAccent,
ShapeBorder this.shape,
VoidCallback this.onPressed])
[ this.txt = '自定义按钮',
this.color = Colors.blueAccent,
this.shape,
this.onPressed])
: super();
getIcons(){

View File

@ -60,7 +60,7 @@ class _DemoState extends State<Demo> {
}
}
/**
/*
* 所有的 IconButton 按钮
*/
Widget allIconButtons(BuildContext context,_DemoState that){

View File

@ -16,7 +16,7 @@ import 'package:flutter/material.dart';
class OutlineButtonDefault extends StatelessWidget {
final bool isDisabled;
const OutlineButtonDefault([bool this.isDisabled = true])
const OutlineButtonDefault([ this.isDisabled = true])
: assert(isDisabled != null),
super();
@ -39,7 +39,7 @@ class OutlineButtonIconDefault extends StatelessWidget {
final IconData icon;
const OutlineButtonIconDefault(
[bool this.isDisabled = true, IconData this.icon = Icons.add_circle])
[ this.isDisabled = true, this.icon = Icons.add_circle])
: super();
@override
@ -66,10 +66,10 @@ class OutlineButtonCustom extends StatelessWidget {
final VoidCallback onPressed;
const OutlineButtonCustom(
[String this.txt = '自定义按钮',
Color this.color = Colors.blueAccent,
ShapeBorder this.shape,
VoidCallback this.onPressed])
[ this.txt = '自定义按钮',
this.color = Colors.blueAccent,
this.shape,
this.onPressed])
: super();
@override

View File

@ -69,7 +69,7 @@ class _DemoState extends State<Demo> {
}
}
/**
/*
* 所有的 OutlineButton 按钮
*/
Widget allOutlineButtons(BuildContext context,_DemoState that){
@ -130,26 +130,26 @@ Widget allOutlineButtons(BuildContext context,_DemoState that){
* alert 弹框
* context:容器的父级
* */
void _showMessage(String name, BuildContext context) {
showDialog(
// alert 的父级
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text('提示'),
content: new Text(name),
actions: <Widget>[
new FlatButton(
// alert 的取消按钮
onPressed: () {
// 取消的事件
Navigator.of(context).pop(true);
},
child: new Text('取消'))
]);
}
);
}
// void _showMessage(String name, BuildContext context) {
// showDialog(
// // alert 的父级
// context: context,
// builder: (BuildContext context) {
// return AlertDialog(
// title: new Text('提示'),
// content: new Text(name),
// actions: <Widget>[
// new FlatButton(
// // alert 的取消按钮
// onPressed: () {
// // 取消的事件
// Navigator.of(context).pop(true);
// },
// child: new Text('取消'))
// ]);
// }
// );
// }
/*
* 带align的text

View File

@ -6,7 +6,6 @@
* email: zhu.yan@alibaba-inc.com
* tartget: RaisedButton 的示例
*/
import 'dart:math';
import 'package:flutter/material.dart';
/*
@ -20,7 +19,7 @@ class PopupMenuButtonDefault extends StatelessWidget {
final String type;
const PopupMenuButtonDefault(
[String this.type = 'default1', bool this.isDisabled = true])
[ this.type = 'default1', this.isDisabled = true])
: assert(isDisabled != null),
super();
@ -107,7 +106,7 @@ class PopupMenuButtonCustom extends StatelessWidget {
label: Text(
'自定义按钮', style: TextStyle(color: Colors.white),
semanticsLabel: 'FLAT BUTTON'),
// onPressed:(){} // 激活状态按钮
onPressed:(){} // 激活状态按钮
),
// 打开时放置菜单的z坐标。这可以控制菜单下方阴影的大小。
elevation:10.0,

View File

@ -9,7 +9,7 @@
*/
import '../../../../../common/widget_demo.dart';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import './demo.dart' as popupMenuButton;
@ -37,8 +37,9 @@ const String _titleText2 = """
class Demo extends StatefulWidget {
static const String routeName = '/element/Form/Button/PopupMenuButton';
final Map<String,String> options = {'defaultSelect': '选项二的内容'};
@override
final _DemoState self = _DemoState();
@override
_DemoState createState() => self;
}

View File

@ -16,7 +16,7 @@ import 'package:flutter/material.dart';
class RaisedButtonDefault extends StatelessWidget {
final bool isDisabled;
const RaisedButtonDefault([bool this.isDisabled = true])
const RaisedButtonDefault([ this.isDisabled = true])
: assert(isDisabled != null),
super();
@ -39,7 +39,7 @@ class RaisedButtonIconDefault extends StatelessWidget {
final IconData icon;
const RaisedButtonIconDefault(
[bool this.isDisabled = true, IconData this.icon = Icons.add_circle])
[ this.isDisabled = true, this.icon = Icons.add_circle])
: super();
Color _randomColor() {
@ -73,10 +73,10 @@ class RaisedButtonCustom extends StatelessWidget {
final VoidCallback onPressed;
const RaisedButtonCustom(
[String this.txt = '自定义按钮',
Color this.color = Colors.blueAccent,
ShapeBorder this.shape,
VoidCallback this.onPressed])
[ this.txt = '自定义按钮',
this.color = Colors.blueAccent,
this.shape,
this.onPressed])
: super();
@override

View File

@ -69,7 +69,7 @@ class _DemoState extends State<Demo> {
}
}
/**
/*
* 所有的 RaisedButton 按钮
*/
Widget allRaisedButtons(BuildContext context,_DemoState that){
@ -130,26 +130,26 @@ Widget allRaisedButtons(BuildContext context,_DemoState that){
* alert 弹框
* context:容器的父级
* */
void _showMessage(String name, BuildContext context) {
showDialog(
// alert 的父级
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text('提示'),
content: new Text(name),
actions: <Widget>[
new FlatButton(
// alert 的取消按钮
onPressed: () {
// 取消的事件
Navigator.of(context).pop(true);
},
child: new Text('取消'))
]);
}
);
}
// void _showMessage(String name, BuildContext context) {
// showDialog(
// // alert 的父级
// context: context,
// builder: (BuildContext context) {
// return AlertDialog(
// title: new Text('提示'),
// content: new Text(name),
// actions: <Widget>[
// new FlatButton(
// // alert 的取消按钮
// onPressed: () {
// // 取消的事件
// Navigator.of(context).pop(true);
// },
// child: new Text('取消'))
// ]);
// }
// );
// }
/*
* 带align的text

View File

@ -16,7 +16,7 @@ import 'package:flutter/material.dart';
class RawMaterialButtonDefault extends StatelessWidget {
final bool isDisabled;
const RawMaterialButtonDefault([bool this.isDisabled = true])
const RawMaterialButtonDefault([ this.isDisabled = true])
: assert(isDisabled != null),
super();
@ -39,10 +39,10 @@ class RawMaterialButtonCustom extends StatelessWidget {
final VoidCallback onPressed;
const RawMaterialButtonCustom(
[String this.txt = '自定义按钮',
Color this.color = Colors.blueAccent,
ShapeBorder this.shape,
VoidCallback this.onPressed])
[ this.txt = '自定义按钮',
this.color = Colors.blueAccent,
this.shape,
this.onPressed])
: super();
@override

View File

@ -58,7 +58,7 @@ class _DemoState extends State<Demo> {
}
}
/**
/*
* 所有的 RawMaterialButton 按钮
*/
Widget allRawMaterialButtons(BuildContext context,_DemoState that){
@ -102,26 +102,26 @@ Widget allRawMaterialButtons(BuildContext context,_DemoState that){
* alert 弹框
* context:容器的父级
* */
void _showMessage(String name, BuildContext context) {
showDialog(
// alert 的父级
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text('提示'),
content: new Text(name),
actions: <Widget>[
new FlatButton(
// alert 的取消按钮
onPressed: () {
// 取消的事件
Navigator.of(context).pop(true);
},
child: new Text('取消'))
]);
}
);
}
// void _showMessage(String name, BuildContext context) {
// showDialog(
// // alert 的父级
// context: context,
// builder: (BuildContext context) {
// return AlertDialog(
// title: new Text('提示'),
// content: new Text(name),
// actions: <Widget>[
// new FlatButton(
// // alert 的取消按钮
// onPressed: () {
// // 取消的事件
// Navigator.of(context).pop(true);
// },
// child: new Text('取消'))
// ]);
// }
// );
// }
/*
* 带align的text

View File

@ -16,7 +16,7 @@ import 'package:flutter/material.dart';
class CheckboxDefault extends StatefulWidget{
final int index;
final parent;
const CheckboxDefault([this.parent,int this.index = -1]) : super();
const CheckboxDefault([this.parent, this.index = -1]) : super();
@override
State<StatefulWidget> createState() =>_CheckboxDefault();
}
@ -47,7 +47,7 @@ class CheckboxSelect extends StatelessWidget {
final widget;
final parent;
const CheckboxSelect([this.widget,this.parent,int this.index = -1])
const CheckboxSelect([this.widget,this.parent, this.index = -1])
: super();
@override

View File

@ -8,7 +8,7 @@
* 对应文档地址:https://docs.flutter.io/flutter/material/Checkbox-class.html
*/
import '../../../../../common/widget_demo.dart';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
@ -54,7 +54,7 @@ class _DemoState extends State<Demo> {
}
}
/**
/*
* 所有的 Checkbox 按钮
*/
Widget allCheckboxs(BuildContext context,_DemoState that){

View File

@ -7,7 +7,6 @@
* tartget: CheckboxListTile 的示例
*/
import 'dart:math';
import 'package:flutter/material.dart';
/*

View File

@ -7,9 +7,8 @@
* tartget: CheckboxListTile 的示例
*/
import '../../../../../common/widget_demo.dart';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import './demo.dart' as CheckboxListTileDemo;
@ -38,7 +37,7 @@ const String _CheckboxListTileText2 =
class Demo extends StatefulWidget {
static const String routeName = '/element/Form/Checkbox/CheckboxListTile';
bool valBool = true;
final bool valBool = true;
@override
_DemoState createState() => _DemoState();
}
@ -55,7 +54,7 @@ class _DemoState extends State<Demo> {
}
}
/**
/*
* 所有的 CheckboxListTile widget
* context: 运行上下文
* that: 指向有状态的 StatefulWidget

View File

@ -10,48 +10,47 @@
import '../../../../../common/widget_demo.dart';
import 'package:flutter/material.dart';
import './text_field_demo.dart' ;
import './text_field_demo.dart';
const String _textFieldText0 =
"""### **简介**
> Text Field “文本字段”
- 文本字段允许用户输入文本,无论是硬件键盘还是屏幕键盘。
- 每当用户更改字段中的文本时文本字段就会调用Onchange的回调。
- 如果用户指示他们在字段中输入完成例如通过按软键盘上的按钮则文本字段调用onSubmitted回调。
const String _textFieldText0 = """### **简介**
> TextField 最常用的文本输入widget
- 该 widget 作为文本输入框,可以接收用户以屏幕按键或者键盘输入的文本信息,该信息可以用于消息传递,搜索体验等
- 用户修改文本信息时Onchange会被调用获取到最新的文本信息
- 已知用户输入的字段文本输入完毕时例如通过按软键盘上的按钮确认输入完毕该widget会调用onSubmitted回调
""";
const String _textFieldText1 =
"""### **基本用法**
> 参数的默认的按钮和禁用按钮
- 默认情况下,文本字段具有在文本字段下方绘制分隔符的修饰
- 您可以使用装饰属性来控制装饰,例如通过添加标签或图标。如果将装饰属性设置为空,则将完全删除装饰,包括装饰引入的额外填充,以节省标签的空间
- 如果装饰是非null这是默认的文本字段需要它的祖先之一是一个材质widget。当文本字段被敲击时墨水溅到材料上的油漆被触发。
- 若要将TeXFieldField集成到其他FieldFieldWrices窗体中请考虑使用TeTFrimeField。""";
const String _textFieldText1 = """### **基本用法**
> 参数控制默认的按钮和禁用按钮
- 默认情况下TextField 下方有一个下划线进行修饰。
- 您可以使用decoration属性来控制该widget样式例如通过添加标签或图标。如果将decoration属性设置为空则将完全删除装饰包括装饰引入的额外填充以节省标签的空间
- 如果decoration属性是非null这是默认的文本字段需要它的父类是一个Material widget。当文本字段被点击时会出发被点击的效果
- 若要将TextField和其他FormFild集成到Form中请考虑使用TeTFrimeField。""";
const String _textFieldText2 =
"""### **进阶用法**
> 实现稍微复杂点的效果键盘就变成了数字优先为输入框做一些其他的效果如提示文字icon、标签文字等
const String _textFieldText2 = """### **进阶用法**
> 实现稍微复杂点的效果TextField 的输入以数字优先为输入框做一些其他的效果如提示文字icon、标签文字等
- 增加一个keyboardType属性把keyboardType设置为 TextInputType.number 让TextField获得焦点的时候弹出的键盘就变成了数字优先。
- 新增decoration属性设置相关属性可以发现当我们的TextField获得焦点时图标会自动变色提示文字会自动上移。
- onChanged是每次输入框内每次文字变更触发的回调onSubmitted是用户提交而触发的回调。
- onChanged是输入框内每次文字变更触发的回调方法onSubmitted是用户提交而触发的回调方法
- 每当用户改变输入框内的文字,都会在控制台输出现在的字符串.与onSubmitted用法相同。
""";
class Demo extends StatefulWidget {
static const String routeName = 'elements/Form/Input/TextField';
@override
_DemoState createState() => _DemoState();
}
class _DemoState extends State<Demo> {
String buttonShapeType = 'border'; // 边框类型
void setButtonShapeType(){
String _buttonShapeType = (buttonShapeType == 'border') ? 'radius' : 'border';
this.setState((){
void setButtonShapeType() {
String _buttonShapeType =
(buttonShapeType == 'border') ? 'radius' : 'border';
this.setState(() {
buttonShapeType = _buttonShapeType;
});
}
@override
Widget build(BuildContext context) {
return WidgetDemo(
@ -68,4 +67,3 @@ class _DemoState extends State<Demo> {
);
}
}

View File

@ -9,7 +9,6 @@
import 'package:flutter/material.dart';
import '../../../../../common/widget_demo.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import 'demo.dart';
const content1 = """
# Radio

View File

@ -1,6 +1,6 @@
import 'package:flutter/widgets.dart';
/**
/*
* Author: xiaojia.dxj
* Date: 2018/11/22
* Email: xiaojia.dxj@alibaba-inc.com
@ -14,7 +14,7 @@ class AlignAlignment extends StatelessWidget {
final Alignment status;
final String dec;
const AlignAlignment(Alignment this.status, String this.dec) : super();
const AlignAlignment( this.status, this.dec) : super();
@override
Widget build(BuildContext context) {
@ -39,8 +39,8 @@ class AlignFactor extends StatelessWidget {
final double hFactor;
final String dec;
const AlignFactor(Alignment this.status, double this.wFactor,
double this.hFactor, String this.dec)
const AlignFactor( this.status, this.wFactor,
this.hFactor, this.dec)
: super();
@override

View File

@ -41,12 +41,12 @@ class _DemoState extends State<Demo> {
contentList: [
_flatText0,
_flatText1,
_AlignCreate()
_alignCreate()
],
);
}
Column _AlignCreate() {
Column _alignCreate() {
return new Column(
children: <Widget>[
SizedBox(height: 10.0),

View File

@ -11,7 +11,7 @@ class _DemoState extends State<Demo> {
Widget build(BuildContext context) {
return WidgetDemo(
title: 'crossAxis',
child: Column(
contentList: [Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
@ -39,7 +39,7 @@ class _DemoState extends State<Demo> {
margin: const EdgeInsets.all(10.0),
),
],
),
)],
docUrl: 'https://docs.flutter.io/flutter/widgets/Padding-class.html',
);
}

View File

@ -37,7 +37,7 @@ class _DemoState extends State<Demo> {
Widget build(BuildContext context) {
return WidgetDemo(
title: 'flipAxis',
child: Flex(
contentList: [Flex(
direction: _direction,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
@ -72,7 +72,7 @@ class _DemoState extends State<Demo> {
onPressed: _changeDirection,
)
],
),
)],
docUrl: 'https://docs.flutter.io/flutter/painting/flipAxis.html',
);
}

View File

@ -1,24 +0,0 @@
import 'package:flutter/material.dart';
import '../../../../model/widget.dart';
import './crossAxis/index.dart' as crossAxis;
import './flipAxis/index.dart' as flipAxis;
import './mainAxis/index.dart' as mainAxis;
List<WidgetPoint> widgetPoints = [
WidgetPoint(
name: 'crossAxis',
routerName: crossAxis.Demo.routeName,
buildRouter: (BuildContext context) => crossAxis.Demo(),
),
WidgetPoint(
name: 'flipAxis',
routerName: flipAxis.Demo.routeName,
buildRouter: (BuildContext context) => flipAxis.Demo(),
),
WidgetPoint(
name: 'mainAxis',
routerName: mainAxis.Demo.routeName,
buildRouter: (BuildContext context) => mainAxis.Demo(),
),
];

View File

@ -11,7 +11,7 @@ class _DemoState extends State<Demo> {
Widget build(BuildContext context) {
return WidgetDemo(
title: 'mainAxis',
child: Flex(
contentList: [Flex(
direction: Axis.vertical,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
@ -42,9 +42,8 @@ class _DemoState extends State<Demo> {
margin: const EdgeInsets.all(10.0),
),
],
),
docUrl:
'https://docs.flutter.io/flutter/material/MergeableMaterial/mainAxis.html',
)],
docUrl: 'https://docs.flutter.io/flutter/material/MergeableMaterial/mainAxis.html',
);
}
}

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
/**
/*
* Author: xiaojia.dxj
* Date: 2018/11/22
* Email: xiaojia.dxj@alibaba-inc.com

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
/**
/*
* Author: xiaojia.dxj
* Date: 2018/11/22
* Email: xiaojia.dxj@alibaba-inc.com

View File

@ -32,13 +32,13 @@ class _DemoState extends State<Demo> {
contentList: [
_Text,
_Text1,
_DecoratedBoxCreate(),
_decoratedBoxCreate(),
],
docUrl: 'https://docs.flutter.io/flutter/widgets/DecoratedBox-class.html',
);
}
Column _DecoratedBoxCreate() {
Column _decoratedBoxCreate() {
return new Column(
children: <Widget>[
Container(

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
/**
/*
* Author: xiaojia.dxj
* Date: 2018/12/2
* Email: xiaojia.dxj@alibaba-inc.com
@ -13,9 +13,9 @@ import 'package:flutter/widgets.dart';
class FittedBoxDefault extends StatelessWidget {
final BoxFit curfit;
String dec;
final String dec;
FittedBoxDefault({Key key, BoxFit this.curfit, this.dec});
FittedBoxDefault({Key key, this.curfit, this.dec});
@override
Widget build(BuildContext context) {

View File

@ -42,12 +42,12 @@ class _DemoState extends State<Demo> {
contentList: [
Text0,
Text1,
_FittedBoxCreate(),
_fittedBoxCreate(),
],
);
}
Column _FittedBoxCreate() {
Column _fittedBoxCreate() {
return Column(
children: <Widget>[
Row(

View File

@ -2,19 +2,19 @@ import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
class OverflowBoxDefault extends StatelessWidget {
double curmaxHeight;
double curmaxWidth;
double curHeight;
double curWidth;
AlignmentGeometry curalignment;
final double curmaxHeight;
final double curmaxWidth;
final double curHeight;
final double curWidth;
final AlignmentGeometry curalignment;
OverflowBoxDefault(
{Key key,
double this.curmaxHeight,
double this.curmaxWidth,
double this.curWidth,
double this.curHeight,
AlignmentGeometry this.curalignment})
this.curmaxHeight,
this.curmaxWidth,
this.curWidth,
this.curHeight,
this.curalignment})
: super(key: key);
@override

View File

@ -5,7 +5,6 @@
* @Last Modified time: 2019-01-08 15:56:31
*/
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import '../../../../../common/widget_demo.dart';
import './demo.dart' as overflowBox;
@ -39,12 +38,12 @@ class _DemoState extends State<Demo> {
contentList: [
Text0,
Text1,
_OverflowBoxCreate(),
_overflowBoxCreate(),
],
);
}
Row _OverflowBoxCreate() {
Row _overflowBoxCreate() {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[

View File

@ -6,7 +6,6 @@
*/
import 'package:flutter/material.dart';
import '../../../../../common/widget_demo.dart';
import './demo.dart' as sizeBox;
const String _Text = '''
### **简介**
@ -35,13 +34,13 @@ class _DemoState extends State<Demo> {
codeUrl: 'elements/Frame/Box/RenderBox/demo.dart',
contentList: [
_Text,
_SizeBoxCreate(),
_sizeBoxCreate(),
],
docUrl: 'https://docs.flutter.io/flutter/widgets/RenderBox-class.html',
);
}
Column _SizeBoxCreate() {
Column _sizeBoxCreate() {
return new Column(
children: <Widget>[
/**

View File

@ -21,13 +21,13 @@ class _DemoState extends State<Demo> {
title: 'Table',
codeUrl: 'elements/Frame/Box/SizedBox/demo.dart',
contentList: [
_SizeBoxCreate(),
_sizeBoxCreate(),
],
docUrl: 'https://docs.flutter.io/flutter/widgets/SizedBox-class.html',
);
}
Column _SizeBoxCreate() {
Column _sizeBoxCreate() {
return new Column(
children: <Widget>[
new Text("SizedBox",

View File

@ -8,9 +8,9 @@ class SizeOverflowBoxDefault extends StatelessWidget {
SizeOverflowBoxDefault(
{Key key,
double this.curSizeWidth,
double this.curSizeHeight,
String this.text})
this.curSizeWidth,
this.curSizeHeight,
this.text})
: super(key: key);
@override
@ -36,7 +36,7 @@ class SizeBoxDefault extends StatelessWidget {
final double curWidth;
final double curHeight;
SizeBoxDefault({Key key, double this.curHeight, double this.curWidth})
SizeBoxDefault({Key key, this.curHeight, this.curWidth})
: super(key: key);
@override

View File

@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import '../../../../../common/widget_demo.dart';
import './demo.dart' as TextBox;
const String _Text = """### **TextBox简介**
> 是一个包含一段文本的矩形

View File

@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
class ExpandedDemo extends StatelessWidget {
TextStyle txtColor = TextStyle(color: Colors.white);
final TextStyle txtColor = TextStyle(color: Colors.white);
@override
Widget build(BuildContext context) {
return Column(

View File

@ -1,6 +1,6 @@
import 'package:flutter/widgets.dart';
/**
/*
* Author: xiaojia.dxj
* Date: 2018/11/22
* Email: xiaojia.dxj@alibaba-inc.com

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
/**
/*
* Author: xiaojia.dxj
* Date: 2018/11/22
* Email: xiaojia.dxj@alibaba-inc.com

View File

@ -1,6 +1,6 @@
import 'package:flutter/widgets.dart';
/**
/*
* Author: xiaojia.dxj
* Date: 2018/11/22
* Email: xiaojia.dxj@alibaba-inc.com
@ -10,7 +10,7 @@ import 'package:flutter/widgets.dart';
* Describle:Row
*/
class RowMainAxisAlignment extends StatelessWidget {
/**
/*
* > mainAxisAlignment属性
* - MainAxisAlignment.spaceEvenly/spaceAround/spaceBetween,
- spaceEvenly将主轴方向空白区域均分使得children之间空间相等包括首尾childre
@ -23,7 +23,7 @@ class RowMainAxisAlignment extends StatelessWidget {
*/
final MainAxisAlignment status;
/**
/*
* > CrossAxisAlignment 属性
- crossAxisAlignment: CrossAxisAlignment.center/end/start,
- 即,根据设定的位置交叉对齐
@ -35,7 +35,7 @@ class RowMainAxisAlignment extends StatelessWidget {
final CrossAxisAlignment crossStatus;
const RowMainAxisAlignment(
MainAxisAlignment this.status, CrossAxisAlignment this.crossStatus)
this.status, this.crossStatus)
: super();
@override

View File

@ -43,12 +43,12 @@ class _DemoState extends State<Demo> {
contentList: [
Text0,
Text1,
_RowCreate(),
_rowCreate(),
],
);
}
Column _RowCreate() {
Column _rowCreate() {
return new Column(
children: <Widget>[
RowLayout(),

View File

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
/**
/*
* Author: xiaojia.dxj
* Date: 2018/11/22
* Email: xiaojia.dxj@alibaba-inc.com
@ -12,7 +12,7 @@ import 'package:flutter/material.dart';
class StackDefault extends StatelessWidget {
final int currIndex;
const StackDefault(int this.currIndex) : super();
const StackDefault( this.currIndex) : super();
@override
Widget build(BuildContext context) {
@ -54,7 +54,7 @@ class StackDefault extends StatelessWidget {
class StackIndex extends StatelessWidget {
final int currIndex;
const StackIndex(int this.currIndex) : super();
const StackIndex( this.currIndex) : super();
@override
Widget build(BuildContext context) {

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import '../../../../../common/widget_demo.dart';
import './demo.dart';
@ -22,7 +21,6 @@ class Demo extends StatefulWidget {
}
class _DemoState extends State<Demo> {
String _desc = "IndexedStack 使用";
int currIndex = 0;
void _indexAdd() {
@ -45,12 +43,12 @@ class _DemoState extends State<Demo> {
contentList: [
_stackText0,
_stackText1,
_IndexedStackCreate(),
_indexedStackCreate(),
],
);
}
Column _IndexedStackCreate() {
Column _indexedStackCreate() {
return new Column(
children: <Widget>[
SizedBox(

View File

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
/**
/*
* Author: xiaojia.dxj
* Date: 2018/11/22
* Email: xiaojia.dxj@alibaba-inc.com

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import '../../../../../common/widget_demo.dart';
import './demo.dart';
@ -36,7 +35,6 @@ class Demo extends StatefulWidget {
}
class _DemoState extends State<Demo> {
String _desc = "Stack 使用";
@override
Widget build(BuildContext context) {
@ -47,7 +45,7 @@ class _DemoState extends State<Demo> {
docUrl: 'https://docs.flutter.io/flutter/widgets/Stack-class.html',
contentList: [
_stackText0,
_StackCreate(),
_stackCreate(),
_stackText1,
new Container(
width: 300.0,
@ -67,7 +65,7 @@ class _DemoState extends State<Demo> {
);
}
Column _StackCreate() {
Column _stackCreate() {
return new Column(
children: <Widget>[
Column(

View File

@ -1 +1 @@
import 'package:flutter/material.dart';
// import 'package:flutter/material.dart';

View File

@ -7,7 +7,7 @@
import 'package:flutter/material.dart';
class IconDemo extends StatelessWidget {
Color curColor = Colors.red;
final Color curColor;
IconDemo({Key key, this.curColor}) : super();

View File

@ -7,7 +7,7 @@
import 'package:flutter/material.dart';
class IconDataDemo extends StatelessWidget {
Color curColor = Colors.red;
final Color curColor ;
IconDataDemo({Key key, this.curColor}) : super();

View File

@ -7,7 +7,7 @@
import 'package:flutter/material.dart';
class IconThemeDemo extends StatelessWidget {
Color curColor = Colors.white;
final Color curColor ;
IconThemeDemo({Key key, this.curColor}) : super();
@ -25,7 +25,7 @@ class IconThemeDemo extends StatelessWidget {
}
class IconThemeDemo2 extends StatelessWidget {
Color curColor = Colors.white;
final Color curColor ;
final double curSize;
IconThemeDemo2({Key key, this.curColor, this.curSize}) : super();

View File

@ -8,8 +8,8 @@
import 'package:flutter/material.dart';
class IconThemeDemo extends StatelessWidget {
Color curColor = Colors.white;
double curOpacity;
final Color curColor ;
final double curOpacity;
IconThemeDemo({Key key, this.curColor, this.curOpacity}) : super();
@ -29,7 +29,7 @@ class IconThemeDemo extends StatelessWidget {
}
class IconThemeDemo2 extends StatelessWidget {
Color curColor = Colors.white;
final Color curColor ;
final double curSize;
IconThemeDemo2({Key key, this.curColor, this.curSize}) : super();

View File

@ -6,8 +6,6 @@
*/
import 'package:flutter/material.dart';
import '../../../../../common/widget_demo.dart';
import './decoration_image_painter_demo.dart';
import 'dart:ui';
const contentText0 = '''
### **简介**

View File

@ -6,7 +6,6 @@
*/
import 'package:flutter/material.dart';
import '../../../../../common/widget_demo.dart';
import './paint_image_demo.dart';
const String contentText0 = '''
### **非Widget 待删除**

View File

@ -5,7 +5,6 @@
* @Last Modified time: 2018-11-16 15:09:12
*/
import 'package:flutter/material.dart';
import '../../../../../common/widget_demo.dart';
class Demo extends StatefulWidget {
static const String routeName = '/element/Media/Image/precacheImage';

View File

@ -14,7 +14,7 @@ class Palette {
final String name;
final MaterialColor primary;
/**
/*
* MaterialAccentColor定义单一的色滴颜色的阴影用索引表示
* 索引比较小的颜色比较浅,较大的索引较暗
*/