Initial commit

This commit is contained in:
2026-02-09 20:10:42 +08:00
parent 1a1cbb1bb3
commit 1f16da8f88
172 changed files with 12461 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
import 'package:flutter/widgets.dart';
class ResponsiveBody extends StatelessWidget {
const ResponsiveBody({
super.key,
required this.child,
this.maxWidth = 960,
this.padding = EdgeInsets.zero,
});
final Widget child;
final double maxWidth;
final EdgeInsetsGeometry padding;
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (context, constraints) {
final width = constraints.maxWidth;
final horizontalPadding = switch (width) {
>= 1200 => 96.0,
>= 900 => 64.0,
>= 600 => 32.0,
_ => 16.0,
};
return Padding(
padding: padding.add(
EdgeInsets.symmetric(horizontal: horizontalPadding),
),
child: Align(
alignment: Alignment.topCenter,
child: ConstrainedBox(
constraints: BoxConstraints(maxWidth: maxWidth),
child: SizedBox(
width: double.infinity,
height: constraints.maxHeight,
child: child,
),
),
),
);
},
);
}
}