首页 > 移动平台 > 详细

Flutter -- iOS -- Row

时间:2019-11-27 19:45:46      阅读:73      评论:0      收藏:0      [点我收藏+]
 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 }

技术分享图片

 

Flutter -- iOS -- Row

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!