其他分享
首页 > 其他分享> > Flutter -- iOS -- Row

Flutter -- iOS -- Row

作者:互联网

 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 }

 

标签:LayoutDemo,title,Text,Expanded,iOS,child,new,Flutter,Row
来源: https://www.cnblogs.com/tom2015010203/p/11944544.html