Major UI overhaul
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import 'app_breakpoints.dart';
|
||||
|
||||
class ResponsiveBody extends StatelessWidget {
|
||||
const ResponsiveBody({
|
||||
super.key,
|
||||
@@ -16,13 +18,18 @@ class ResponsiveBody extends StatelessWidget {
|
||||
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,
|
||||
};
|
||||
final height = constraints.hasBoundedHeight
|
||||
? constraints.maxHeight
|
||||
: MediaQuery.sizeOf(context).height;
|
||||
final width = constraints.hasBoundedWidth
|
||||
? constraints.maxWidth
|
||||
: maxWidth;
|
||||
final horizontalPadding = AppBreakpoints.horizontalPadding(width);
|
||||
final boxConstraints = BoxConstraints(
|
||||
maxWidth: maxWidth,
|
||||
minHeight: height,
|
||||
maxHeight: height,
|
||||
);
|
||||
|
||||
return Padding(
|
||||
padding: padding.add(
|
||||
@@ -31,12 +38,8 @@ class ResponsiveBody extends StatelessWidget {
|
||||
child: Align(
|
||||
alignment: Alignment.topCenter,
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(maxWidth: maxWidth),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
height: constraints.maxHeight,
|
||||
child: child,
|
||||
),
|
||||
constraints: boxConstraints,
|
||||
child: SizedBox(width: width, child: child),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user