https://flutterchina.club/tutorials/layout/
官方代码GitHub无法打开,按顺序书写代码报错,刚接触Flutter想先敲写实例代码再系统学习,面对报错束手无策。现在问题解决了,做下记录,整理下代码。
- 先理一下代码结构
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
1、实现标题行
Widget titleSection = new Container();
2、实现按钮行
Column buildButtonColumn(IconData icon, String label) { }
Widget buttonSection = new Container();
3、实现文本部分
Widget textSection = new Container();
// 创建一个Material APP
return new MaterialApp(
title: 'Welcome to Flutter',
home: new Scaffold(
appBar: new AppBar(
title: new Text('Welcome to Flutter'),
),
body: new ListView(
children