Flutter Widget之Row

Widget:https://flutter.io/docs/development/ui/widgets
Row:https://docs.flutter.io/flutter/widgets/Row-class.html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import 'package:flutter/material.dart';

class RowDemoPage extends StatefulWidget {
@override
State<StatefulWidget> createState() => new _RowDemoPageState();
}

class _RowDemoPageState extends State<RowDemoPage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(title: new Text('Row Page Demo'),),
body: Center(
// child: Row(
// children: <Widget>[
// Expanded(
// child: Text('Deliver features faster', textAlign: TextAlign.center),
// ),
// Expanded(
// child: Text('Craft beautiful UIs', textAlign: TextAlign.center),
// ),
// Expanded(
// child: FittedBox(
// fit: BoxFit.contain, // otherwise the logo will be tiny
// child: const FlutterLogo(),
// ),
// ),
// ],
// )
child: Row(
children: <Widget>[
const FlutterLogo(),
// const Text('Flutter\'s hot reload helps you quickly and easily experiment, build UIs, add features, and fix bug faster. Experience sub-second reload times, without losing state, on emulators, simulators, and hardware for iOS and Android.'),
const Expanded(
child: Text('Flutter\'s hot reload helps you quickly and easily experiment, build UIs, add features, and fix bug faster. Experience sub-second reload times, without losing state, on emulators, simulators, and hardware for iOS and Android.'),
),
const Icon(Icons.sentiment_very_satisfied),
],
)
),
);
}
}

Flutter Widget Row

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :