防采集标记:亢少军老师的课程和资料
import 'package:flutter/material.dart';
void main() => runApp(
new MaterialApp(
title: '水平布局示例',
home: new LayoutDemo(),
),
);
class LayoutDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text('水平布局示例'),
),
body: new Row(
children: [
new Expanded(
child: new Text('左侧文本', textAlign: TextAlign.center),
),
new Expanded(
child: new Text('中间文本', textAlign: TextAlign.center),
),
new Expanded(
child: new FittedBox(
fit: BoxFit.contain,
child: const FlutterLogo(),
),
),
],
),
);
}
}
- Flutter技术入门与实战: http://product.dangdang.com/26485813.html
- Flutter交流学习群:894109159
- Flutter开源项目请关注: https://github.com/kangshaojun
- Flutter视频教程:https://edu.csdn.net/lecturer/2436
@作者: 亢少军