mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-06-01 14:58:50 +08:00
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:
@ -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);
|
||||
|
@ -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){
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||

|
||||
## 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){
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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(){
|
||||
|
@ -60,7 +60,7 @@ class _DemoState extends State<Demo> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 所有的 IconButton 按钮
|
||||
*/
|
||||
Widget allIconButtons(BuildContext context,_DemoState that){
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user