From c057d31d21f84bcaef0a88ac2624b7ed20f230c8 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Fri, 9 Apr 2021 15:48:50 +0200 Subject: [PATCH] fix: Add normal mode again to OnePageCard --- lib/components/one_page_card.dart | 54 ++++++++++++++++--------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/lib/components/one_page_card.dart b/lib/components/one_page_card.dart index c316079b..1b925532 100644 --- a/lib/components/one_page_card.dart +++ b/lib/components/one_page_card.dart @@ -10,31 +10,33 @@ class OnePageCard extends StatelessWidget { static const int alpha = 64; @override Widget build(BuildContext context) { - return Container( - decoration: BoxDecoration( - color: Theme.of(context).backgroundColor, - gradient: LinearGradient( - begin: Alignment.topRight, - end: Alignment.bottomLeft, - stops: [ - 0.1, - 0.4, - 0.6, - 0.9, - ], - colors: [ - Theme.of(context).secondaryHeaderColor.withAlpha(alpha), - Theme.of(context).primaryColor.withAlpha(alpha), - Theme.of(context).accentColor.withAlpha(alpha), - Theme.of(context).backgroundColor.withAlpha(alpha), - ], - ), - ), - padding: EdgeInsets.symmetric( - horizontal: max((MediaQuery.of(context).size.width - 600) / 2, 0), - vertical: max((MediaQuery.of(context).size.height - 800) / 2, 0), - ), - child: SafeArea(child: Card(child: child)), - ); + return MediaQuery.of(context).size.width <= 600 + ? child + : Container( + decoration: BoxDecoration( + color: Theme.of(context).backgroundColor, + gradient: LinearGradient( + begin: Alignment.topRight, + end: Alignment.bottomLeft, + stops: [ + 0.1, + 0.4, + 0.6, + 0.9, + ], + colors: [ + Theme.of(context).secondaryHeaderColor.withAlpha(alpha), + Theme.of(context).primaryColor.withAlpha(alpha), + Theme.of(context).accentColor.withAlpha(alpha), + Theme.of(context).backgroundColor.withAlpha(alpha), + ], + ), + ), + padding: EdgeInsets.symmetric( + horizontal: max((MediaQuery.of(context).size.width - 600) / 2, 0), + vertical: max((MediaQuery.of(context).size.height - 800) / 2, 0), + ), + child: SafeArea(child: Card(child: child)), + ); } }