Last active
September 4, 2019 10:18
-
-
Save 1000copy/cf59f463d1e16c72e2329f081a1eb04f to your computer and use it in GitHub Desktop.
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/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
Widget b(BuildContext context) { | |
return Center( | |
child:Column( | |
crossAxisAlignment: CrossAxisAlignment.center, | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: <Widget>[ | |
Container( | |
color: Colors.blue, | |
child:Text("一个产品\n欢迎你"), | |
), | |
Container( | |
child: new FlatButton( | |
child: Text("圆角按钮"), | |
color:Colors.red, | |
shape: new RoundedRectangleBorder( | |
borderRadius: new BorderRadius.circular(30.0), | |
), | |
onPressed: () {}, | |
) | |
), | |
Row(children: <Widget>[ | |
Icon( | |
Icons.star, | |
color: Colors.red[500], | |
),Icon( | |
Icons.star, | |
color: Colors.black, | |
), | |
],), | |
Container( | |
margin: const EdgeInsets.all(40), | |
color: Colors.blue, | |
child:Text("添加边距"), | |
), | |
Row( | |
mainAxisAlignment: MainAxisAlignment.spaceEvenly, | |
children: <Widget>[Text("均分"),Text("空间"),],), | |
Container( | |
color: Colors.blue, | |
child:Text("登录就意味着你认了"), | |
), | |
Container( | |
color: Colors.red, | |
//child: Text("**ccc") | |
child:new Image.asset("assets/images/g.png"), | |
), | |
new Expanded( | |
child: new Align( | |
alignment: Alignment.bottomCenter, | |
child: new Text("沉底的组件/服务热线00001111"), | |
), | |
), | |
Container( | |
color: Colors.red, | |
child: Text("把胁迫到底的组件/@copyright") | |
), | |
], | |
), | |
); | |
} | |
Widget c(BuildContext context) { | |
return Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
crossAxisAlignment: CrossAxisAlignment.center, | |
children: <Widget>[ | |
new FlatButton( | |
child: Text("圆角按钮"), | |
color:Colors.red, | |
shape: new RoundedRectangleBorder( | |
borderRadius: new BorderRadius.circular(30.0), | |
), | |
onPressed: () {}, | |
), | |
new FlatButton( | |
child: Text("圆角按钮"), | |
color:Colors.red, | |
shape: new RoundedRectangleBorder( | |
borderRadius: new BorderRadius.circular(30.0), | |
), | |
onPressed: () {}, | |
), | |
Text("abc"), | |
Text("def"), | |
Text("abc"), | |
Text("abc"), | |
new Expanded( | |
child: new Align( | |
alignment: Alignment.bottomCenter, | |
child: new Text("沉底的组件/服务热线00001111"), | |
), | |
), | |
], | |
); | |
} | |
Widget d(BuildContext context) { | |
return Column( | |
//mainAxisAlignment: MainAxisAlignment.spaceEvenly, | |
children:[ | |
Container(color:Colors.red,child: Text("飞向天"),), | |
Expanded(child: Center(child:Text("老子在中间。\n终于,中对齐了!\n充满客户区,尽量大"))),// | |
Container(color:Colors.purple,child: Text("贴着地"),) | |
]); | |
} | |
@override | |
Widget build(BuildContext context) { | |
// final wordPair = WordPair.random(); | |
return MaterialApp( | |
title: 'Welcome', | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text('Hello - Again'), | |
), | |
body: d(context) | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment