flutter OverflowBox溢出父容器显示示例

2020-08-28  本文已影响0人  喜剧收尾_XWX
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return MaterialApp(
        title: "OverflowBox溢出父容器显示示例",
        home: Scaffold(
            appBar: AppBar(
              title: Text('OverflowBox溢出父容器显示示例'),
            ),
            body: Container(
              width: 200,
              height: 200,
              color: Colors.greenAccent,
              padding: EdgeInsets.all(10),
              child: OverflowBox(
                alignment: Alignment.topLeft,
                maxHeight: 300,
                maxWidth: 300,
                child: Container(
                  color: Colors.deepOrange,
                  width: 350,
                  height: 350,
                ),
              ),
            )));
  }
}
上一篇 下一篇

猜你喜欢

热点阅读