Created
February 15, 2020 16:57
-
-
Save ryanlid/1cb8c14a626e9219f107d12cb3725d04 to your computer and use it in GitHub Desktop.
OverflowBox 溢出父容器显示
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class LayoutDemo extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text("OverflowBox 溢出父容器显示示例"), | |
), | |
body: Container( | |
color: Colors.green, | |
width: 200.0, | |
height: 200.0, | |
padding: EdgeInsets.all(50.0), | |
child: OverflowBox( | |
alignment: Alignment.topLeft, | |
maxWidth: 400.0, | |
maxHeight: 400.0, | |
child: Container( | |
color: Colors.blueGrey, | |
width: 300.0, | |
height: 300.0, | |
), | |
), | |
), | |
); | |
} | |
} | |
void main() { | |
runApp(MaterialApp( | |
title: "OverflowBox 溢出父容器显示示例", | |
home: LayoutDemo(), | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment