Rollback sized container

This commit is contained in:
LittleSheep 2024-08-07 00:12:44 +08:00
parent 0bfc0bd61b
commit 035b92d9b8

View File

@ -16,9 +16,8 @@ class SizedContainer extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Align( return Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: LimitedBox( child: Container(
maxWidth: maxWidth, constraints: BoxConstraints(maxWidth: maxWidth, maxHeight: maxHeight),
maxHeight: maxHeight,
child: child, child: child,
), ),
); );
@ -38,8 +37,8 @@ class CenteredContainer extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Center( return Center(
child: LimitedBox( child: Container(
maxWidth: maxWidth, constraints: BoxConstraints(maxWidth: maxWidth),
child: child, child: child,
), ),
); );