mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-09-27 00:24:40 +08:00
fix:code
This commit is contained in:
@ -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),
|
||||
|
@ -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)
|
||||
],
|
||||
|
Reference in New Issue
Block a user