From 11f8eb61a1340d03b9592e7d7dda02a63ab8e14b Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sun, 24 Apr 2022 07:57:08 +0200 Subject: [PATCH] chore: Login design follow up dark mode fix --- lib/config/themes.dart | 6 ++++++ lib/pages/connect/connect_page_view.dart | 6 +++++- .../homeserver_picker_view.dart | 18 +++++++++++++--- lib/pages/login/login_view.dart | 21 ++++++++++++++----- lib/pages/sign_up/signup_view.dart | 19 ++++++++++++----- 5 files changed, 56 insertions(+), 14 deletions(-) diff --git a/lib/config/themes.dart b/lib/config/themes.dart index dd268512..dcc707d9 100644 --- a/lib/config/themes.dart +++ b/lib/config/themes.dart @@ -13,6 +13,8 @@ abstract class FluffyThemes { static const fallbackTextStyle = TextStyle(fontFamily: 'Roboto', fontFamilyFallback: ['NotoEmoji']); + static const TextStyle loginTextFieldStyle = TextStyle(color: Colors.black); + static InputDecoration loginTextFieldDecoration({ String? errorText, String? labelText, @@ -26,6 +28,9 @@ abstract class FluffyThemes { hintText: hintText, suffixIcon: suffixIcon, prefixIcon: prefixIcon, + suffixIconColor: Colors.black, + prefixIconColor: Colors.black, + iconColor: Colors.black, errorText: errorText, errorStyle: TextStyle( color: Colors.red.shade200, @@ -37,6 +42,7 @@ abstract class FluffyThemes { ), ], ), + hintStyle: TextStyle(color: Colors.grey.shade700), labelStyle: const TextStyle( color: Colors.white, shadows: [ diff --git a/lib/pages/connect/connect_page_view.dart b/lib/pages/connect/connect_page_view.dart index 24465b96..39ac584c 100644 --- a/lib/pages/connect/connect_page_view.dart +++ b/lib/pages/connect/connect_page_view.dart @@ -90,8 +90,12 @@ class ConnectPageView extends StatelessWidget { child: TextField( controller: controller.usernameController, onSubmitted: (_) => controller.signUp(), + style: FluffyThemes.loginTextFieldStyle, decoration: FluffyThemes.loginTextFieldDecoration( - prefixIcon: const Icon(Icons.account_box_outlined), + prefixIcon: const Icon( + Icons.account_box_outlined, + color: Colors.black, + ), hintText: L10n.of(context)!.chooseAUsername, errorText: controller.signupError, ), diff --git a/lib/pages/homeserver_picker/homeserver_picker_view.dart b/lib/pages/homeserver_picker/homeserver_picker_view.dart index e24b136c..76f7e301 100644 --- a/lib/pages/homeserver_picker/homeserver_picker_view.dart +++ b/lib/pages/homeserver_picker/homeserver_picker_view.dart @@ -40,10 +40,14 @@ class HomeserverPickerView extends StatelessWidget { focusNode: controller.homeserverFocusNode, controller: controller.homeserverController, onChanged: controller.onChanged, + style: FluffyThemes.loginTextFieldStyle, decoration: FluffyThemes.loginTextFieldDecoration( labelText: L10n.of(context)!.homeserver, hintText: L10n.of(context)!.enterYourHomeserver, - suffixIcon: const Icon(Icons.search), + suffixIcon: const Icon( + Icons.search, + color: Colors.black, + ), errorText: controller.error, ), readOnly: !AppConfig.allowOtherHomeservers, @@ -70,7 +74,10 @@ class HomeserverPickerView extends StatelessWidget { .map( (server) => ListTile( trailing: IconButton( - icon: const Icon(Icons.info_outlined), + icon: const Icon( + Icons.info_outlined, + color: Colors.black, + ), onPressed: () => controller.showServerInfo(server), ), @@ -78,9 +85,14 @@ class HomeserverPickerView extends StatelessWidget { server.homeserver.baseUrl.host), title: Text( server.homeserver.baseUrl.host, + style: const TextStyle( + color: Colors.black), ), subtitle: Text( - server.homeserver.description ?? ''), + server.homeserver.description ?? '', + style: TextStyle( + color: Colors.grey.shade700), + ), ), ) .toList(), diff --git a/lib/pages/login/login_view.dart b/lib/pages/login/login_view.dart index c545779e..7d1c69d1 100644 --- a/lib/pages/login/login_view.dart +++ b/lib/pages/login/login_view.dart @@ -44,10 +44,14 @@ class LoginView extends StatelessWidget { controller: controller.usernameController, textInputAction: TextInputAction.next, keyboardType: TextInputType.emailAddress, + style: FluffyThemes.loginTextFieldStyle, autofillHints: controller.loading ? null : [AutofillHints.username], decoration: FluffyThemes.loginTextFieldDecoration( - prefixIcon: const Icon(Icons.account_box_outlined), + prefixIcon: const Icon( + Icons.account_box_outlined, + color: Colors.black, + ), errorText: controller.usernameError, hintText: L10n.of(context)!.emailOrUsername, ), @@ -64,14 +68,21 @@ class LoginView extends StatelessWidget { textInputAction: TextInputAction.next, obscureText: !controller.showPassword, onSubmitted: controller.login, + style: FluffyThemes.loginTextFieldStyle, decoration: FluffyThemes.loginTextFieldDecoration( - prefixIcon: const Icon(Icons.lock_outlined), + prefixIcon: const Icon( + Icons.lock_outlined, + color: Colors.black, + ), errorText: controller.passwordError, suffixIcon: IconButton( tooltip: L10n.of(context)!.showPassword, - icon: Icon(controller.showPassword - ? Icons.visibility_off_outlined - : Icons.visibility_outlined), + icon: Icon( + controller.showPassword + ? Icons.visibility_off_outlined + : Icons.visibility_outlined, + color: Colors.black, + ), onPressed: controller.toggleShowPassword, ), hintText: L10n.of(context)!.password, diff --git a/lib/pages/sign_up/signup_view.dart b/lib/pages/sign_up/signup_view.dart index 3e3bdc33..41bc4595 100644 --- a/lib/pages/sign_up/signup_view.dart +++ b/lib/pages/sign_up/signup_view.dart @@ -38,12 +38,18 @@ class SignupPageView extends StatelessWidget { obscureText: !controller.showPassword, validator: controller.password1TextFieldValidator, decoration: FluffyThemes.loginTextFieldDecoration( - prefixIcon: const Icon(Icons.vpn_key_outlined), + prefixIcon: const Icon( + Icons.vpn_key_outlined, + color: Colors.black, + ), suffixIcon: IconButton( tooltip: L10n.of(context)!.showPassword, - icon: Icon(controller.showPassword - ? Icons.visibility_off_outlined - : Icons.visibility_outlined), + icon: Icon( + controller.showPassword + ? Icons.visibility_off_outlined + : Icons.visibility_outlined, + color: Colors.black, + ), onPressed: controller.toggleShowPassword, ), hintText: L10n.of(context)!.chooseAStrongPassword, @@ -61,7 +67,10 @@ class SignupPageView extends StatelessWidget { controller.loading ? null : [AutofillHints.username], validator: controller.emailTextFieldValidator, decoration: FluffyThemes.loginTextFieldDecoration( - prefixIcon: const Icon(Icons.mail_outlined), + prefixIcon: const Icon( + Icons.mail_outlined, + color: Colors.black, + ), hintText: L10n.of(context)!.enterAnEmailAddress, errorText: controller.error), ),