添加OrientationBuilder、MaterialBanner、CupertinoTextField、ValueListenableBuilder组件

This commit is contained in:
toly
2020-07-22 10:52:12 +08:00
parent 918217f46a
commit 9fc4b83e5c
10 changed files with 353 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
import 'package:flutter/material.dart';
/// create by 张风捷特烈 on 2020/7/21
/// contact me by email 1981462002@qq.com
/// 说明: 211 MaterialBanner Material风格的横幅组件支持左中右或左中下结构可指定边距背景色等。
// {
// "widgetId": 211,
// "name": 'MaterialBanner一行的使用',
// "priority": 1,
// "subtitle": "【content】 : 中间组件 【Widget】\n"
// "【leading】: 左侧组件 【Widget】\n"
// "【actions】: 右侧组件列表 【List<Widget>】\n"
// "【padding】: 内边距 【EdgeInsetsGeometry】\n"
// "【forceActionsBelow】: 是否按钮在下方 【bool】\n"
// "【backgroundColor】: 背景色 【Color】",
// }
class MaterialBannerDemo extends StatelessWidget {
final info =
'Welcome to Flutter Unit!';
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[MaterialBanner(
content: Text(
info,
style: TextStyle(color: Colors.white),
),
backgroundColor: Colors.purple,
leading: Icon(Icons.info, color: Colors.lightBlueAccent),
padding: EdgeInsetsDirectional.only(start: 16.0, top: 2.0),
forceActionsBelow: false, // 默认false
actions: <Widget>[
Text(
'I KNOW',
style:TextStyle(
color: Colors.orange,
fontWeight: FontWeight.bold,
fontSize: 14) ,
)
],
)],
);
}
}

View File

@@ -0,0 +1,60 @@
import 'package:flutter/material.dart';
/// create by 张风捷特烈 on 2020/7/21
/// contact me by email 1981462002@qq.com
/// 说明:
// {
// "widgetId": 211,
// "name": 'MaterialBanner两行的使用',
// "priority": 2,
// "subtitle": "【contentTextStyle】: 中间位置样式 【TextStyle】\n"
// "【leadingPadding】: 左侧组件边距 【EdgeInsetsGeometry】\n"
// "当尾部组件数量大于1,该组件结构为左中下。",
// }
class MaterialBannerDemoTwo extends StatelessWidget {
final info =
'A banner displays an important, succinct message, and provides actions for users to address. '
'A user action is required for itto be dismissed.';
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[MaterialBanner(
content: Text(
info,
style: TextStyle(color: Colors.white),
),
backgroundColor: Colors.purple,
leading: Icon(Icons.warning, color: Colors.yellow),
padding: EdgeInsetsDirectional.only(start: 16.0, top: 2.0,end: 2),
leadingPadding:EdgeInsetsDirectional.only(end: 16.0) ,
actions: <Widget>[
RaisedButton(
color: Colors.white,
onPressed: () {},
child: Text(
'I KNOW',
style: TextStyle(
color: Colors.purple,
fontWeight: FontWeight.bold,
fontSize: 14),
),
),
RaisedButton(
color: Colors.white,
onPressed: () {},
child: Text(
'I IGNORE',
style: TextStyle(
color: Colors.purple,
fontWeight: FontWeight.bold,
fontSize: 14),
),
),
],
)],
);
}
}