第7章页面布局-SizedBox设置具体尺寸

防采集标记:亢少军老师的课程和资料

import 'package:flutter/material.dart';

class LayoutDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text('SizedBox设置具体尺寸示例'),
      ),
      body: SizedBox(
        //固定宽为200.0 高为300.0
        width: 200.0,
        height: 300.0,
        child: const Card(
            child: Text('SizedBox',
              style: TextStyle(
                fontSize: 36.0,
              ),
            )),
      ),
    );
  }
}

void main() {
  runApp(
    new MaterialApp(
      title: 'SizedBox设置具体尺寸示例',
      home: new LayoutDemo(),
    ),
  );
}

@作者: 亢少军

第7章页面布局-SizedBox设置具体尺寸