Flutter Widget之Column

Widget:https://flutter.io/docs/development/ui/widgets
Column:https://docs.flutter.io/flutter/widgets/Column-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
import 'package:flutter/material.dart';

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

class _ColumnDemoPageState extends State<ColumnDemoPage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(title: new Text('Column Page Demo'),),
body: Center(
// child: Column(
// children: <Widget>[
// Text('Deliver features faster'),
// Text('Craft beautiful UIs'),
// Expanded(
// child: FittedBox(
// fit: BoxFit.contain, // otherwise the logo will be tiny
// child: const FlutterLogo(),
// ),
// ),
// ],
// )
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text('We move under cover and we move as one'),
Text('Through the night, we have one shot to live another day'),
Text('We cannot let a stray gunshot give us away'),
Text('We will fight up close, seize the moment and stay in it'),
Text('It\'s either that or meet the business end of a bayonet'),
Text('The code word is \'Rochambeau\', dig me?'),
Text('Rochambeau!', style: DefaultTextStyle.of(context).style.apply(fontSizeFactor: 2.0)),
],
),
),
);
}
}

Flutter Widget Column

Powered by AppBlog.CN     浙ICP备14037229号

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

访客数 : | 访问量 :