From 5c76f6e0a69795afc7dfddf1583ec7932309341c Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 4 May 2020 19:28:09 +0200 Subject: [PATCH] Fix login route theme --- lib/ui/widgets/login_scaffold.dart | 65 +++++++++++++++++++----------- 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/lib/ui/widgets/login_scaffold.dart b/lib/ui/widgets/login_scaffold.dart index ae7f31d..9950c62 100644 --- a/lib/ui/widgets/login_scaffold.dart +++ b/lib/ui/widgets/login_scaffold.dart @@ -18,40 +18,57 @@ class LoginScaffold extends StatelessWidget { final availableHeight = mediaQuery.size.height - mediaQuery.viewInsets.bottom; - final minHeight = 400.0; + final minHeight = 450.0; final contentHeight = availableHeight < minHeight ? minHeight : availableHeight; - return Scaffold( - body: SingleChildScrollView( - child: Center( - child: Container( - height: contentHeight, - child: ConstrainedBox( - constraints: BoxConstraints(maxWidth: 300), - child: Column( - children: [ - Spacer(flex: 3), - Text("Comunic", style: TextStyle(fontSize: 50)), - Spacer(flex: 1), - Text(tr("Free social network that respect your privacy")), - Spacer(flex: 1), - Padding( - padding: const EdgeInsets.all(8.0), - child: Material( - child: child, - color: Colors.indigo.shade500, + return Theme( + data: Theme.of(context).copyWith( + hintColor: Colors.white, + inputDecorationTheme: InputDecorationTheme( + errorStyle: TextStyle(color: Colors.white), + hintStyle: TextStyle(color: Colors.white), + labelStyle: TextStyle(color: Colors.white), + focusColor: Colors.white, + fillColor: Colors.white, + hoverColor: Colors.white, + ), + scaffoldBackgroundColor: Colors.indigo.shade900, + textTheme: TextTheme( + body1: TextStyle(color: Colors.white), + button: TextStyle(color: Colors.white), + ), + ), + child: Scaffold( + body: SingleChildScrollView( + child: Center( + child: Container( + height: contentHeight, + child: ConstrainedBox( + constraints: BoxConstraints(maxWidth: 300), + child: Column( + children: [ + Spacer(flex: 3), + Text("Comunic", style: TextStyle(fontSize: 50)), + Spacer(flex: 1), + Text(tr("Free social network that respect your privacy")), + Spacer(flex: 1), + Padding( + padding: const EdgeInsets.all(8.0), + child: Material( + child: child, + color: Colors.indigo.shade500, + ), ), - ), - Spacer(flex: 5), - ], + Spacer(flex: 5), + ], + ), ), ), ), ), ), - backgroundColor: Colors.indigo.shade900, ); } }