Merge branch 'krille/fix-login-darkmode' into 'main'

chore: Login design follow up dark mode fix

See merge request famedly/fluffychat!839
This commit is contained in:
Krille Fear 2022-04-24 06:17:28 +00:00
commit 22f803078e
5 changed files with 56 additions and 14 deletions

View File

@ -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: [

View File

@ -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,
),

View File

@ -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(),

View File

@ -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
icon: Icon(
controller.showPassword
? Icons.visibility_off_outlined
: Icons.visibility_outlined),
: Icons.visibility_outlined,
color: Colors.black,
),
onPressed: controller.toggleShowPassword,
),
hintText: L10n.of(context)!.password,

View File

@ -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
icon: Icon(
controller.showPassword
? Icons.visibility_off_outlined
: Icons.visibility_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),
),