game/lib/widgets/responsive_container.dart

25 lines
539 B
Dart

import 'package:flutter/material.dart';
class ResponsiveContainer extends StatelessWidget {
final Widget child;
final double maxWidth;
final double maxHeight;
const ResponsiveContainer({
Key? key,
required this.child,
this.maxWidth = 600.0,
this.maxHeight = 1000.0,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Center(
child: ConstrainedBox(
constraints: BoxConstraints(maxWidth: maxWidth, maxHeight: maxHeight),
child: child,
),
);
}
}