This commit is contained in:
xiaojia22326@163.com
2019-01-31 17:18:16 +08:00
parent acfe8f6ed8
commit c4cbd02123
130 changed files with 773 additions and 913 deletions

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),