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

import 'package:flutter/material.dart';

class LayoutDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
        appBar: new AppBar(
          title: new Text('OverflowBox溢出父容器显示示例'),
        ),
        body: Container(
          color: Colors.green,
          width: 200.0,
          height: 200.0,
          padding: const EdgeInsets.all(5.0),
          child: OverflowBox(
            alignment: Alignment.topLeft,
            maxWidth: 300.0,
            maxHeight: 500.0,
            child: Container(
              color: Colors.blueGrey,
              width: 400.0,
              height: 400.0,
            ),
          ),
        ));
  }
}

void main() {
  runApp(
    new MaterialApp(
      title: 'OverflowBox溢出父容器显示示例',
      home: new LayoutDemo(),
    ),
  );
}

@作者: 亢少军

第7章页面布局-OverflowBox溢出父容器显示

相关文章:

  • 2022-01-03
  • 2021-06-18
  • 2021-05-03
  • 2021-12-04
  • 2021-08-01
  • 2021-09-04
  • 2021-10-05
  • 2022-01-12
猜你喜欢
  • 2021-11-01
  • 2021-07-19
  • 2022-01-09
  • 2021-07-13
  • 2022-01-12
  • 2021-07-24
  • 2021-05-27
相关资源
相似解决方案