fix: code conflict

This commit is contained in:
yifeng.yl
2019-02-03 00:48:57 +08:00
181 changed files with 2261 additions and 1158 deletions

View File

@ -18,13 +18,13 @@ class AlignAlignment extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Container(
return Container(
color: Color(0xffd81b60),
width: 90.0,
height: 50.0,
child: new Align(
child: Align(
alignment: status,
child: new Text(
child: Text(
dec,
style: TextStyle(fontSize: 12.0, color: Color(0xffffffff)),
),
@ -45,10 +45,10 @@ class AlignFactor extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Container(
margin: new EdgeInsets.only(top: 10.0, bottom: 10.0),
return Container(
margin: EdgeInsets.only(top: 10.0, bottom: 10.0),
color: Color(0xffd81b60),
child: new Align(
child: Align(
alignment: status,
widthFactor: wFactor,
heightFactor: hFactor,

View File

@ -40,10 +40,10 @@ class _DemoState extends State<Demo> {
}
Column _alignCreate() {
return new Column(
return Column(
children: <Widget>[
SizedBox(height: 10.0),
new Row(
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
AlignAlignment(Alignment.center, 'center'),
@ -51,7 +51,7 @@ class _DemoState extends State<Demo> {
],
),
SizedBox(height: 10.0),
new Row(
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
AlignAlignment(Alignment.centerRight, 'centerRight'),
@ -60,7 +60,7 @@ class _DemoState extends State<Demo> {
],
),
SizedBox(height: 10.0),
new Row(
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
AlignAlignment(Alignment.topLeft, 'topLeft'),
@ -71,11 +71,11 @@ class _DemoState extends State<Demo> {
SizedBox(height: 10.0),
MarkdownBody(data: _flatText1),
Container(
margin: new EdgeInsets.only(top: 20.0, bottom: 20.0),
margin: EdgeInsets.only(top: 20.0, bottom: 20.0),
color: Color(0xffe91e63),
child: new Align(
child: Align(
alignment: Alignment.topLeft,
child: new Text(
child: Text(
"Align",
style: TextStyle(color: Color(0xffffffff)),
),

View File

@ -29,12 +29,12 @@ class ConstrainedBoxCreate extends StatelessWidget {
maxWidth: 300.0,
maxHeight: 50.0,
),
child: new Container(
child: Container(
margin: const EdgeInsets.only(left: 20.0, right: 20.0),
//child 宽高超过制定限制范围失效,效果宽/高=100/20区域
width: currWidth,
height: 250.0,
child: new Text(
child: Text(
describe,
style: TextStyle(color: Colors.white),
),

View File

@ -21,7 +21,7 @@ class DecoratedBoxCreate extends StatelessWidget {
decoration: BoxDecoration(
color: const Color(0xff7c94b6),
//设置图片内容
image: new DecorationImage(
image: DecorationImage(
fit: BoxFit.cover,
image: ExactAssetImage('assets/images/food01.jpeg')),
//外宽边框,可以不设置
@ -46,7 +46,7 @@ class DecoratedBoxCreateTwo extends StatelessWidget {
decoration: BoxDecoration(
color: const Color(0xff7c94b6),
//设置图片内容
image: new DecorationImage(
image: DecorationImage(
fit: BoxFit.cover,
image: ExactAssetImage('assets/images/food01.jpeg')),
//根据传入的不同大小,呈现图片效弧度不同,
@ -67,7 +67,7 @@ class DecoratedBoxCreateShape extends StatelessWidget {
position: DecorationPosition.background,
decoration: BoxDecoration(
color: const Color(0xff7c94b6),
image: new DecorationImage(
image: DecorationImage(
fit: BoxFit.cover,
image: ExactAssetImage('assets/images/food01.jpeg')),
border: Border.all(

View File

@ -45,7 +45,7 @@ class _DemoState extends State<Demo> {
}
Column _decoratedBoxCreate() {
return new Column(
return Column(
children: <Widget>[
Container(
height: 100.0,

View File

@ -15,11 +15,11 @@ class FittedBoxDefault extends StatelessWidget {
final BoxFit curfit;
final String dec;
FittedBoxDefault({Key key, this.curfit, this.dec});
FittedBoxDefault({Key key, this.curfit, this.dec});
@override
Widget build(BuildContext context) {
return new Column(
return Column(
children: <Widget>[
Container(
//

View File

@ -1,4 +1,3 @@
/**
* Author: xiaojia.dxj
* Date: 2019-01-08
@ -9,7 +8,7 @@
*/
import 'package:flutter/material.dart';
import 'package:flutter_go/components/widget_demo.dart';
import './demo.dart' as fittedBox;
import './demo.dart';
const String Text0 = """
### **FittedBox**
@ -53,18 +52,16 @@ class _DemoState extends State<Demo> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
fittedBox.FittedBoxDefault(
/**
* child写入布局期间分配空间
*/
FittedBoxDefault(
//child写入布局期间分配空间
curfit: BoxFit.contain,
dec: 'contain',
),
fittedBox.FittedBoxDefault(
FittedBoxDefault(
curfit: BoxFit.fill,
dec: 'fill',
),
fittedBox.FittedBoxDefault(
FittedBoxDefault(
curfit: BoxFit.cover,
dec: 'cover',
),
@ -76,11 +73,11 @@ class _DemoState extends State<Demo> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
fittedBox.FittedBoxDefault(
FittedBoxDefault(
curfit: BoxFit.fitHeight,
dec: 'fitHeight',
),
fittedBox.FittedBoxDefault(
FittedBoxDefault(
curfit: BoxFit.fitWidth,
dec: 'fitWidth',
),
@ -92,11 +89,11 @@ class _DemoState extends State<Demo> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
fittedBox.FittedBoxDefault(
FittedBoxDefault(
curfit: BoxFit.none,
dec: 'none',
),
fittedBox.FittedBoxDefault(
FittedBoxDefault(
curfit: BoxFit.scaleDown,
dec: 'scaleDown',
),

View File

@ -10,11 +10,11 @@ class OverflowBoxDefault extends StatelessWidget {
OverflowBoxDefault(
{Key key,
this.curmaxHeight,
this.curmaxWidth,
this.curWidth,
this.curHeight,
this.curalignment})
this.curmaxHeight,
this.curmaxWidth,
this.curWidth,
this.curHeight,
this.curalignment})
: super(key: key);
@override
@ -25,18 +25,18 @@ class OverflowBoxDefault extends StatelessWidget {
//设置最大宽,高
maxWidth: curmaxWidth,
maxHeight: curmaxHeight,
/**
* 调整child位置
*/
//调整child位置
alignment: curalignment,
child: Container(
/**
* widget宽高大于overflowBox设置的最大以overflowbox设置的最大宽高为限制
* 小于overflowBox 设置的最大限度子widget能够完全显示
* * */
//widget宽高大于overflowBox设置的最大以overflowbox设置的最大宽高为限制
//小于overflowBox 设置的最大限度子widget能够完全显示
height: curHeight,
width: curWidth,
child: Text("$curmaxWidth * $curmaxHeight",style: TextStyle(color: Colors.white),),
child: Text(
"$curmaxWidth * $curmaxHeight",
style: TextStyle(color: Colors.white),
),
color: Color(0xfff48fb1),
),
);

View File

@ -76,7 +76,10 @@ class _DemoState extends State<Demo> {
),
),
SizedBox(height: 20),
SizedBox(height: 50,child: Text("宽高都大于最大限制"),),
SizedBox(
height: 50,
child: Text("宽高都大于最大限制"),
),
Container(
width: 100.0,
height: 100.0,
@ -90,7 +93,6 @@ class _DemoState extends State<Demo> {
curalignment: Alignment.center,
),
),
],
);
}

View File

@ -1,22 +0,0 @@
import 'package:flutter/material.dart';
class RenderBoxDemo extends StatefulWidget {
_RenderBoxDemoState createState() => _RenderBoxDemoState();
}
class _RenderBoxDemoState extends State<RenderBoxDemo> {
@override
Widget build(BuildContext context) {
return Container(
// child: RenderFoo(),
);
}
}
class RenderFoo extends RenderBox {
@override
bool get hasSize => super.hasSize;
@override
BoxConstraints get constraints => super.constraints;
}

View File

@ -1,62 +0,0 @@
/*
* @Author: xiaojia.dxj
* @Date: 2019-01-08 15:56:26
* @Last Modified by: xiaojia.dxj
* @Last Modified time: 2019-01-08 15:56:26
*/
import 'package:flutter/material.dart';
import 'package:flutter_go/components/widget_demo.dart';
const String _Text = '''
### **简介**
> BoxConstraints为抽象类我们可以使用BoxConstraints,一个不可边的约束布局renderBox布局
- 一个尺寸尊重一个BoxConstraints当且仅当以下关系式的成立
minWidth <= Size.width <= maxWidth
minHeight <= Size.height <= maxHeight
约束本身必须满足这些关系:
0.0 <= minWidth <= maxWidth <= double.infinity
0.0 <= minHeight <= maxHeight <= double.infinity
double.infinity是每个约束的合法值。
''';
class Demo extends StatefulWidget {
static const String routeName = '/element/Frame/Box/RenderBox';
_DemoState createState() => _DemoState();
}
class _DemoState extends State<Demo> {
@override
Widget build(BuildContext context) {
return WidgetDemo(
title: 'Table',
codeUrl: 'elements/Frame/Box/RenderBox/demo.dart',
contentList: [
_Text,
_sizeBoxCreate(),
],
docUrl: 'https://docs.flutter.io/flutter/widgets/RenderBox-class.html',
);
}
Column _sizeBoxCreate() {
return new Column(
children: <Widget>[
/**
* Immutable layout constraints for RenderBox layout.
*/
SizedBox(
width: 900.0,
height: 50.0,
child: const Card(
child: Text(
'SizedBox',
textAlign: TextAlign.center,
),
color: Color(0xFFEF5350)),
),
],
);
}
}

View File

@ -28,15 +28,15 @@ class _DemoState extends State<Demo> {
}
Column _sizeBoxCreate() {
return new Column(
return Column(
children: <Widget>[
new Text("SizedBox",
Text("SizedBox",
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 28.0,
fontWeight: FontWeight.bold,
)),
new Row(
Row(
children: <Widget>[
sizeBox.SizeBoxDefault(),
SizedBox(

View File

@ -7,10 +7,7 @@ class SizeOverflowBoxDefault extends StatelessWidget {
final String text;
SizeOverflowBoxDefault(
{Key key,
this.curSizeWidth,
this.curSizeHeight,
this.text})
{Key key, this.curSizeWidth, this.curSizeHeight, this.text})
: super(key: key);
@override
@ -23,7 +20,7 @@ class SizeOverflowBoxDefault extends StatelessWidget {
color: Color(0xfff06292),
width: 50.0,
height: 50.0,
child: new Text(
child: Text(
text,
style: TextStyle(color: Colors.white),
),
@ -36,8 +33,7 @@ class SizeBoxDefault extends StatelessWidget {
final double curWidth;
final double curHeight;
SizeBoxDefault({Key key, this.curHeight, this.curWidth})
: super(key: key);
SizeBoxDefault({Key key, this.curHeight, this.curWidth}) : super(key: key);
@override
Widget build(BuildContext context) {

View File

@ -6,7 +6,7 @@
*/
import 'package:flutter/material.dart';
import 'package:flutter_go/components/widget_demo.dart';
import './demo.dart' as sizeBox;
import './demo.dart';
// const String _Text = """### **SizeBox简介**
// > 常用的一个控件,设置具体尺寸。
@ -53,47 +53,47 @@ class _DemoState extends State<Demo> {
}
Column _sizedOverflowBoxCreate() {
return new Column(
return Column(
children: <Widget>[
sizeBox.SizeBoxDefault(
SizeBoxDefault(
curWidth: 200.0,
curHeight: 50.0,
),
SizedBox(height: 20.0),
Container(
margin: new EdgeInsets.only(top: 10.0),
margin: EdgeInsets.only(top: 10.0),
color: Color(0xffd81b60),
width: 200.0,
height: 50.0,
),
Container(
margin: new EdgeInsets.only(top: 10.0),
margin: EdgeInsets.only(top: 10.0),
color: Color(0xffd81b60),
alignment: Alignment.topCenter,
width: 200.0,
height: 50.0,
child: sizeBox.SizeOverflowBoxDefault(
child: SizeOverflowBoxDefault(
text: "SizeBox",
),
),
Container(
margin: new EdgeInsets.only(top: 10.0),
margin: EdgeInsets.only(top: 10.0),
color: Color(0xffd81b60),
width: 200.0,
height: 50.0,
child: sizeBox.SizeOverflowBoxDefault(
child: SizeOverflowBoxDefault(
text: "box",
curSizeWidth: 100.0,
curSizeHeight: 20.0,
),
),
Container(
margin: new EdgeInsets.only(top: 10.0),
margin: EdgeInsets.only(top: 10.0),
color: Color(0xffd81b60),
width: 200.0,
height: 50.0,
alignment: Alignment.center,
child: sizeBox.SizeOverflowBoxDefault(
child: SizeOverflowBoxDefault(
text: "box",
curSizeWidth: 100.0,
curSizeHeight: 20.0,

View File

@ -1,49 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter_go/components/widget_demo.dart';
const String _Text = """### **TextBox简介**
> 是一个包含一段文本的矩形
- 它与rect类似不过包含一个固定的TextDirection。
- sizebox的widthheigh为nullchild自身设置
### **属性**
> width
> height
- ex:200*50 sizebox
""";
class Demo extends StatefulWidget {
static const String routeName = '/element/Frame/Box/TextBox';
_DemoState createState() => _DemoState();
}
class _DemoState extends State<Demo> {
@override
Widget build(BuildContext context) {
return WidgetDemo(
title: 'TextBox',
codeUrl: 'elements/Frame/Box/TextBox/demo.dart',
contentList: [
_Text,
_creatTexbox(),
],
docUrl: 'https://docs.flutter.io/flutter/dart-ui/TextBox-class.html',
);
}
}
Column _creatTexbox() {
return Column(
children: <Widget>[
// Text("TextBox ",textDirection: new TextBox.fo,),
Container(
// child: TextBox.fromLTRB(270.0, 180.0, 1360.0, 730.0,TextDirection.rtl),
)
// centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0),
],
);
}

View File

@ -6,7 +6,7 @@ class UnconstrainedBoxDemo extends StatelessWidget {
return UnconstrainedBox(
constrainedAxis: Axis.vertical,
textDirection: TextDirection.rtl,
child: new Row(
child: Row(
children: <Widget>[
Container(
width: 100.0,

View File

@ -5,7 +5,6 @@ import 'ConstrainedBox/index.dart' as ConstrainedBox;
import 'DecoratedBox/index.dart' as DecoratedBox;
import 'SizeBox/index.dart' as SizeBox;
import 'SizedOverflowBox/index.dart' as SizedOverflowBox;
import 'TextBox/index.dart' as TextBox;
import 'UnconstrainedBox/index.dart' as UnconstrainedBox;
import 'OverflowBox/index.dart' as OverflowBox;
import 'FittedBox/index.dart' as FittedBox;
@ -33,11 +32,6 @@ List<WidgetPoint> widgetPoints = [
routerName: SizedOverflowBox.Demo.routeName,
buildRouter: (BuildContext context) => SizedOverflowBox.Demo(),
),
WidgetPoint(
name: 'TextBox',
routerName: TextBox.Demo.routeName,
buildRouter: (BuildContext context) => TextBox.Demo(),
),
WidgetPoint(
name: 'UnconstrainedBox',
routerName: UnconstrainedBox.Demo.routeName,

View File

@ -13,57 +13,57 @@ class ExpandedDemo extends StatelessWidget {
return Column(
children: <Widget>[
Text('Expanded'),
Row(children: <Widget>[
RaisedButton(
Row(children: <Widget>[
RaisedButton(
onPressed: () {
print('点击红色按钮事件');
},
color: const Color(0xffcc0000),
child: Text('红色按钮',style: txtColor,),
child: Text('红色按钮',style: txtColor,),
),
Expanded(
Expanded(
flex: 1,//flex用来设置当前可用空间的占优比
child: RaisedButton(
child: RaisedButton(
onPressed: () {
print('点击黄色按钮事件');
},
color: const Color(0xfff1c232),
child: Text('黄色按钮',style: txtColor,),
child: Text('黄色按钮',style: txtColor,),
),
),
RaisedButton(
RaisedButton(
onPressed: () {
print('点击粉色按钮事件');
},
color: const Color(0xffea9999),
child: Text('粉色按钮',style: txtColor,),
child: Text('粉色按钮',style: txtColor,),
),
]),
Text('Flexible'),
Row(children: <Widget>[
RaisedButton(
Row(children: <Widget>[
RaisedButton(
onPressed: () {
print('点击红色按钮事件');
},
color: const Color(0xffcc0000),
child: Text('红色按钮',style: txtColor,),
child: Text('红色按钮',style: txtColor,),
),
Flexible(
Flexible(
flex: 1,
child: RaisedButton(
child: RaisedButton(
onPressed: () {
print('点击黄色按钮事件');
},
color: const Color(0xfff1c232),
child: Text('黄色按钮',style: txtColor,),
child: Text('黄色按钮',style: txtColor,),
),
),
RaisedButton(
RaisedButton(
onPressed: () {
print('点击粉色按钮事件');
},
color: const Color(0xffea9999),
child: Text('粉色按钮',style: txtColor,),
child: Text('粉色按钮',style: txtColor,),
),
]),
],

View File

@ -13,33 +13,31 @@ class ColumnDefault extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
/**
* - MainAxisAlignment.spaceEvenly/spaceAround/spaceBetween,
- spaceEvenly将主轴方向空白区域均分使得children之间空间相等包括首尾childre
- spaceAround将主轴方向空白区域均分使得children之间空间相等但是首尾childre的空白部分为一半
- spaceBetween将主轴方向空白区域均分使得children之间空间相等但是首尾childre靠近收尾没有空细逢
/// - MainAxisAlignment.spaceEvenly/spaceAround/spaceBetween,
/// - spaceEvenly将主轴方向空白区域均分使得children之间空间相等包括首尾childre
/// - spaceAround将主轴方向空白区域均分使得children之间空间相等但是首尾childre的空白部分为一半
/// - spaceBetween将主轴方向空白区域均分使得children之间空间相等但是首尾childre靠近收尾,没有空细逢
/// - MainAxisAlignment.start/end/center,
/// - start将children放置在主轴起点方向
/// - end将children放置在主轴末尾方向
/// - center将children放置在主轴中间方向
- MainAxisAlignment.start/end/center,
- start将children放置在主轴起点方向
- end将children放置在主轴末尾方向
- center将children放置在主轴中间方向
*/
mainAxisAlignment: MainAxisAlignment.center,
/**
* > mainAxisSize 属性
- 一行的高度是有mainAxisSize属性控制默认是max
- mainAxisSize: MainAxisSize.min,一行的宽度是child传入的约束
- mainAxisSize: MainAxisSize.max,一行的宽度的最大宽度是传入的约束。
> mainAxisAlignment属性
*/
mainAxisSize: MainAxisSize.max,
/**
* - crossAxisAlignment: CrossAxisAlignment.center/end/start,
- 即,根据设定的位置交叉对齐
- center/end/start: children交叉轴上居中/末端/起点 对齐展示
- stretch让children填满交叉轴方向
- baseline在交叉轴方向使得于这个baseline对齐如果主轴是垂直的那么这个值是当作开始
*/
/// > mainAxisSize 属性
/// - 一行的高度是有mainAxisSize属性控制默认是max
/// - mainAxisSize: MainAxisSize.min,一行的宽度是child传入的约束
/// - mainAxisSize: MainAxisSize.max,一行的宽度的最大宽度是传入的约束。
/// > mainAxisAlignment属性
/// mainAxisSize: MainAxisSize.max,
///- crossAxisAlignment: CrossAxisAlignment.center/end/start,
/// - 即,根据设定的位置交叉对齐
/// - center/end/start: children在交叉轴上居中/末端/起点 对齐展示
/// - stretchchildren填满交叉轴方向
/// - baseline在交叉轴方向使得于这个baseline对齐如果主轴是垂直的那么这个值是当作开始
children: <Widget>[
Container(
color: Color(0xfffce4ec),

View File

@ -10,27 +10,24 @@ import 'package:flutter/widgets.dart';
* Describle:Row
*/
class RowMainAxisAlignment extends StatelessWidget {
/*
* > mainAxisAlignment属性
* - MainAxisAlignment.spaceEvenly/spaceAround/spaceBetween,
- spaceEvenly将主轴方向空白区域均分使得children之间空间相等包括首尾childre
- spaceAround将主轴方向空白区域均分使得children之间空间相等但是首尾childre的空白部分为一半
- spaceBetween将主轴方向空白区域均分使得children之间空间相等但是首尾childre靠近收尾没有空细逢
* - MainAxisAlignment.start/end/center,
- start将children放置在主轴起点方向
- end将children放置在主轴末尾方向
- center将children放置在主轴中间方向
*/
///> mainAxisAlignment属性
/// - MainAxisAlignment.spaceEvenly/spaceAround/spaceBetween,
/// - spaceEvenly将主轴方向空白区域均分使得children之间空间相等包括首尾childre
/// - spaceAround将主轴方向空白区域均分使得children之间空间相等但是首尾childre的空白部分为一半
/// - spaceBetween将主轴方向空白区域均分使得children之间空间相等但是首尾childre靠近收尾,没有空细逢
/// - MainAxisAlignment.start/end/center,
/// - start将children放置在主轴起点方向
/// - end将children放置在主轴末尾方向
/// - center将children放置在主轴中间方向
final MainAxisAlignment status;
/*
* > CrossAxisAlignment 属性
- crossAxisAlignment: CrossAxisAlignment.center/end/start,
- 即,根据设定的位置交叉对齐
- center/end/start: children交叉轴上居中/末端/起点 对齐展示
- stretch让children填满交叉轴方向
- baseline在交叉轴方向使得于这个baseline对齐如果主轴是垂直的那么这个值是当作开始
*/
/// > CrossAxisAlignment 属性
/// - crossAxisAlignment: CrossAxisAlignment.center/end/start,
/// - 即,根据设定的位置交叉对齐
/// - center/end/start: children在交叉轴上居中/末端/起点 对齐展示
/// - stretchchildren填满交叉轴方向
/// - baseline在交叉轴方向使得于这个baseline对齐如果主轴是垂直的那么这个值是当作开始
final CrossAxisAlignment crossStatus;
@ -38,7 +35,7 @@ class RowMainAxisAlignment extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Row(
return Row(
mainAxisAlignment: status,
children: <Widget>[
Container(
@ -66,29 +63,29 @@ class RowLayoutCreate extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Row(
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
margin: new EdgeInsets.only(top: 20.0, bottom: 20.0),
margin: EdgeInsets.only(top: 20.0, bottom: 20.0),
color: Color(0xfffce4ec),
width: 60.0,
height: 50.0,
),
Container(
margin: new EdgeInsets.only(top: 20.0, bottom: 20.0),
margin: EdgeInsets.only(top: 20.0, bottom: 20.0),
color: Color(0xfff8bbd0),
width: 60.0,
height: 50.0,
),
Container(
margin: new EdgeInsets.only(top: 20.0, bottom: 20.0),
margin: EdgeInsets.only(top: 20.0, bottom: 20.0),
color: Color(0xfff48fb1),
width: 60.0,
height: 50.0,
),
Container(
margin: new EdgeInsets.only(top: 20.0, bottom: 20.0),
margin: EdgeInsets.only(top: 20.0, bottom: 20.0),
color: Color(0xfff06292),
width: 60.0,
height: 50.0,

View File

@ -49,7 +49,7 @@ class _DemoState extends State<Demo> {
}
Column _rowCreate() {
return new Column(
return Column(
children: <Widget>[
RowLayoutCreate(),
Row(

View File

@ -49,12 +49,12 @@ class SliverPaddingDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new CustomScrollView(
return CustomScrollView(
shrinkWrap: true,
slivers: <Widget>[
new SliverPadding(
SliverPadding(
padding: const EdgeInsets.fromLTRB(50.0,10.0,20.0,0.0),
sliver: new SliverList(
sliver: SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return _buildItem(context, products[index]);

View File

@ -12,7 +12,7 @@ import 'package:flutter/material.dart';
class StackDefault extends StatelessWidget {
final int currIndex;
const StackDefault( this.currIndex) : super();
const StackDefault(this.currIndex) : super();
@override
Widget build(BuildContext context) {
@ -23,14 +23,14 @@ class StackDefault extends StatelessWidget {
// backgroundImage: AssetImage('images/timg.jpeg'),
// radius: 100.0,
// ),
// new Image.asset(
// Image.asset(
// 'images/timg.jpeg',
// width: 600.0,
// height: 240.0,
// fit: BoxFit.cover,
// ),
CircleAvatar(
backgroundColor: new Color(0xfff48fb1),
backgroundColor: Color(0xfff48fb1),
radius: 40.0,
),
Container(
@ -54,34 +54,34 @@ class StackDefault extends StatelessWidget {
class StackIndex extends StatelessWidget {
final int currIndex;
const StackIndex( this.currIndex) : super();
const StackIndex(this.currIndex) : super();
@override
Widget build(BuildContext context) {
return IndexedStack(
index: currIndex,
children: [
new Icon(
Icon(
Icons.update,
size: 40.0,
color: Color(0xffe91e63),
),
new Icon(
Icon(
Icons.access_alarm,
size: 40.0,
color: Color(0xffe91e63),
),
new Icon(
Icon(
Icons.add_alarm,
size: 40.0,
color: Color(0xffe91e63),
),
new Icon(
Icon(
Icons.access_time,
size: 40.0,
color: Color(0xffe91e63),
),
new Icon(
Icon(
Icons.alarm_off,
size: 40.0,
color: Color(0xffe91e63),

View File

@ -38,8 +38,7 @@ class _DemoState extends State<Demo> {
return WidgetDemo(
title: 'IndexedStack',
// desc: _desc,
codeUrl:
'elements/Frame/Stack/IndexedStack/demo.dart',
codeUrl: 'elements/Frame/Stack/IndexedStack/demo.dart',
docUrl: 'https://docs.flutter.io/flutter/widgets/IndexedStack-class.html',
contentList: [
_stackText0,
@ -50,20 +49,20 @@ class _DemoState extends State<Demo> {
}
Column _indexedStackCreate() {
return new Column(
return Column(
children: <Widget>[
SizedBox(
height: 10.0,
),
new Row(
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Container(
color: new Color(0xffe91e63),
color: Color(0xffe91e63),
child: StackDefault(0),
),
Container(
color: new Color(0xffe91e63),
color: Color(0xffe91e63),
child: StackDefault(1),
)
],
@ -71,7 +70,7 @@ class _DemoState extends State<Demo> {
SizedBox(
height: 10.0,
),
new Row(
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
StackIndex(0),
@ -91,7 +90,7 @@ class _DemoState extends State<Demo> {
onPressed: () {
_indexAdd();
},
icon: new Icon(Icons.adb),
icon: Icon(Icons.adb),
label: Text("点击这里")),
StackIndex(currIndex)
],

View File

@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
* LastUpdateTime: 2018/11/22
* LastUpdateBy: xj.deng
*
* Describle:Align描述
* Describle:stack描述
*/
class StackDefault extends StatelessWidget {
const StackDefault() : super();
@ -16,19 +16,19 @@ class StackDefault extends StatelessWidget {
Widget build(BuildContext context) {
return Column(
children: <Widget>[
new Stack(
Stack(
//fit :定义如何设置non-positioned节点尺寸
fit: StackFit.loose,
overflow: Overflow.clip,
textDirection: TextDirection.ltr,
alignment: Alignment.center,
children: [
new Container(
color: new Color(0xfff48fb1),
Container(
color: Color(0xfff48fb1),
width: 100.0,
height: 50.0,
),
new Text("stack demo",
Text("stack demo",
textDirection: TextDirection.ltr,
style: TextStyle(
fontSize: 20.0,
@ -49,22 +49,22 @@ class StackDefault2 extends StatelessWidget {
Widget build(BuildContext context) {
return Column(
children: <Widget>[
new Stack(
Stack(
//fit :定义如何设置non-positioned节点尺寸
fit: StackFit.loose,
overflow: Overflow.clip,
textDirection: TextDirection.ltr,
alignment: Alignment.center,
children: [
new Text("stack demo",
Text("stack demo",
textDirection: TextDirection.ltr,
style: TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
letterSpacing: 5.0,
color: Colors.white)),
new Container(
color: new Color(0xfff48fb1),
Container(
color: Color(0xfff48fb1),
width: 100.0,
height: 50.0,
),
@ -80,32 +80,32 @@ class StackPositioned extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Stack(
return Stack(
alignment: Alignment.center,
children: <Widget>[
new Positioned(
child: new Icon(
Positioned(
child: Icon(
Icons.monetization_on,
size: 40.0,
color: Colors.yellow[300],
)),
new Positioned(
Positioned(
left: 40.0,
child: new Icon(
child: Icon(
Icons.monetization_on,
size: 40.0,
color: Colors.yellow[600],
)),
new Positioned(
Positioned(
left: 60.0,
child: new Icon(
child: Icon(
Icons.monetization_on,
size: 40.0,
color: Colors.yellow[600],
)),
new Positioned(
Positioned(
left: 80.0,
child: new Icon(
child: Icon(
Icons.monetization_on,
size: 40.0,
color: Colors.yellow[600],
@ -120,12 +120,12 @@ class StackLayout extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Stack(
return Stack(
overflow: Overflow.visible,
alignment: const Alignment(0.2, 0.6),
children: <Widget>[
CircleAvatar(
backgroundColor: new Color(0xfff48fb1),
backgroundColor: Color(0xfff48fb1),
radius: 140.0,
),
Container(

View File

@ -35,30 +35,28 @@ class Demo extends StatefulWidget {
}
class _DemoState extends State<Demo> {
@override
Widget build(BuildContext context) {
return WidgetDemo(
title: 'Stack',
codeUrl:
'elements/Frame/Stack/Stack/demo.dart',
codeUrl: 'elements/Frame/Stack/Stack/demo.dart',
docUrl: 'https://docs.flutter.io/flutter/widgets/Stack-class.html',
contentList: [
_stackText0,
_stackCreate(),
_stackText1,
new Container(
Container(
width: 300.0,
height: 100.0,
margin: new EdgeInsets.only(top: 10.0, bottom: 10.0),
color: new Color(0xffe91e63),
margin: EdgeInsets.only(top: 10.0, bottom: 10.0),
color: Color(0xffe91e63),
child: StackPositioned(),
),
_stackText2,
new Container(
Container(
width: 200.0,
height: 200.0,
color: new Color(0xffe91e63),
color: Color(0xffe91e63),
child: StackLayout(),
),
],
@ -66,18 +64,18 @@ class _DemoState extends State<Demo> {
}
Column _stackCreate() {
return new Column(
return Column(
children: <Widget>[
Column(
children: <Widget>[
new Container(
margin: new EdgeInsets.only(top: 10.0, bottom: 10.0),
Container(
margin: EdgeInsets.only(top: 10.0, bottom: 10.0),
width: 300.0,
height: 100.0,
color: Color(0xffe91e63),
child: StackDefault(),
),
new Container(
Container(
width: 300.0,
height: 100.0,
color: Color(0xffe91e63),

View File

@ -1,4 +1,4 @@
import 'spacing/index.dart' as Spacing;
import 'Spacing/index.dart' as Spacing;
import 'Expanded/index.dart' as Expanded;
// import 'Axis/index.dart' as Axis;