Created
December 21, 2019 08:32
-
-
Save Aaron009/c9c6a67f8952d51d7f79e98680bb0cf3 to your computer and use it in GitHub Desktop.
Container包含Container出现的问题。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( | |
title: 'Flutter Demo', | |
theme: new ThemeData(), | |
home: new MyHomePage(title: 'Flutter Demo Home Page'), | |
); | |
} | |
} | |
class MyHomePage extends StatefulWidget { | |
MyHomePage({Key key, this.title}) : super(key: key); | |
final String title; | |
@override | |
_MyHomePageState createState() => new _MyHomePageState(); | |
} | |
class _MyHomePageState extends State<MyHomePage> { | |
@override | |
Widget build(BuildContext context) { | |
return new Scaffold( | |
appBar: new AppBar( | |
title: new Text(widget.title), | |
), | |
body: new Center( | |
child: new Column( | |
children: <Widget>[ | |
Container( | |
margin: EdgeInsets.only(top: 10), | |
width: 200, | |
height: 200, | |
decoration: BoxDecoration( | |
border: Border.all(color: Colors.orange[400], width: 0.5), | |
borderRadius: BorderRadius.circular(6), | |
color: Colors.orange[100]), | |
child: Container( | |
margin: EdgeInsets.only(top: 10), | |
width: 50, | |
height: 50, | |
decoration: BoxDecoration( | |
borderRadius: BorderRadius.circular(6), | |
color: Colors.orange), | |
child: Text('22'), | |
), | |
), | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我想实现这个效果
![1](https://user-images.githubusercontent.com/3838050/71305458-7f0bc600-23cc-11ea-836d-bd70d673c27f.png)