Flutter -- iOS -- Row

时间:2019-11-27 19:45:46   收藏:0   阅读:75
 1 import package:flutter/material.dart;
 2 
 3 class LayoutDemo extends StatelessWidget{
 4   @override
 5   Widget build(BuildContext context) {
 6     // TODO: implement build
 7     return new Scaffold(
 8       appBar: new AppBar(
 9         title: new Text(水平布局示例),
10       ),
11       body: new Row(
12         children: <Widget>[
13           new Expanded(child: new Text(左侧文本,textAlign: TextAlign.center)),
14           new Expanded(child: new Text(中间文本,textAlign: TextAlign.center)),
15           new Expanded(child: new FittedBox(fit: BoxFit.contain,child: const FlutterLogo()))
16         ],
17       ),
18     );
19   }
20 }
21 
22 void main(){
23   runApp(
24     new MaterialApp(
25       title: 水平对齐,
26       home: new LayoutDemo(),
27     ),
28   );
29 }

技术分享图片

 

原文:https://www.cnblogs.com/tom2015010203/p/11944544.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!