feat: Redesign start page

This commit is contained in:
Krille Fear 2021-11-15 09:48:21 +01:00
commit bf79b57007
8 changed files with 117 additions and 85 deletions

View file

@ -1,12 +0,0 @@
import 'package:flutter/material.dart';
class FluffyBanner extends StatelessWidget {
const FluffyBanner({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Image.asset(Theme.of(context).brightness == Brightness.dark
? 'assets/banner_dark.png'
: 'assets/banner.png');
}
}

View file

@ -14,6 +14,8 @@ class OnePageCard extends StatelessWidget {
static num breakpoint = FluffyThemes.columnWidth * 2;
@override
Widget build(BuildContext context) {
final horizontalPadding =
max((MediaQuery.of(context).size.width - 600) / 2, 24);
return MediaQuery.of(context).size.width <= breakpoint ||
Matrix.of(context).client.isLogged()
? child
@ -25,13 +27,13 @@ class OnePageCard extends StatelessWidget {
),
),
child: Padding(
padding: EdgeInsets.symmetric(
horizontal:
max((MediaQuery.of(context).size.width - 600) / 2, 24),
vertical:
max((MediaQuery.of(context).size.height - 800) / 2, 24),
padding: EdgeInsets.only(
top: 16,
left: horizontalPadding,
right: horizontalPadding,
bottom: max((MediaQuery.of(context).size.height - 600) / 2, 24),
),
child: SafeArea(child: Card(elevation: 5, child: child)),
child: SafeArea(child: Card(elevation: 16, child: child)),
),
);
}