From 9ad928d8f081538460a0c88f06c4ae39bf6741e9 Mon Sep 17 00:00:00 2001 From: Mikael de Verdier Date: Fri, 21 Aug 2026 01:59:05 +0200 Subject: [PATCH] changed elevatedButtons to textButtons; added overlayColor for textButtons for all themes; minor improvements --- lib/screens/login/login_ui.dart | 10 ++-------- lib/themes.dart | 7 +++++++ lib/widgets/forgotten_password.dart | 23 +++-------------------- 3 files changed, 12 insertions(+), 28 deletions(-) diff --git a/lib/screens/login/login_ui.dart b/lib/screens/login/login_ui.dart index 01b8452d..9b9db0e6 100644 --- a/lib/screens/login/login_ui.dart +++ b/lib/screens/login/login_ui.dart @@ -212,18 +212,12 @@ class _LoginUIState extends State with SingleTickerProviderStateMixin { ) { final _loginButton = ScaleTransition( scale: loginBtnAnimation as Animation, - child: ElevatedButton( - style: ElevatedButton.styleFrom( - backgroundColor: Theme.of(context).colorScheme.primary, - ), + child: TextButton( key: Key("login_btn"), onPressed: state is! LoginLoading ? _onLoginButtonPressed : null, child: Text( t.loginLogIn, - style: TextStyle( - color: Theme.of(context).colorScheme.onSecondary, - fontSize: 16 - ), + style: TextStyle(fontSize: 16), ))); final _loadingIcon = ScaleTransition(scale: loadingAnimation as Animation, child: CircularProgressIndicator()); diff --git a/lib/themes.dart b/lib/themes.dart index b87ab481..41cd0de5 100644 --- a/lib/themes.dart +++ b/lib/themes.dart @@ -94,6 +94,7 @@ final ThemeData themeFdark = ThemeData( style: ButtonStyle( backgroundColor: WidgetStateProperty.all(Colors.orange[700]!), foregroundColor: WidgetStateProperty.all(Colors.white), + overlayColor: WidgetStateProperty.all(Colors.white.withAlpha(26)), ), ), @@ -177,6 +178,7 @@ final ThemeData themeN = ThemeData( style: ButtonStyle( backgroundColor: WidgetStateProperty.all(Colors.green[700]!), foregroundColor: WidgetStateProperty.all(Colors.white), + overlayColor: WidgetStateProperty.all(Colors.white.withAlpha(26)), ), ), @@ -260,6 +262,7 @@ final ThemeData themePi = ThemeData( style: ButtonStyle( backgroundColor: WidgetStateProperty.all(Color.fromARGB(255, 245, 147, 35)), foregroundColor: WidgetStateProperty.all(Colors.black), + overlayColor: WidgetStateProperty.all(Colors.white.withAlpha(26)), ), ), @@ -374,6 +377,7 @@ final ThemeData themeF = ThemeData( style: ButtonStyle( backgroundColor: WidgetStateProperty.all(Colors.orange[700]!), foregroundColor: WidgetStateProperty.all(Colors.white), + overlayColor: WidgetStateProperty.all(Colors.white.withAlpha(26)), ), ), @@ -425,6 +429,7 @@ final ThemeData themeO = ThemeData( style: ButtonStyle( backgroundColor: WidgetStateProperty.all(const Color.fromRGBO(191, 54, 12, 1)), foregroundColor: WidgetStateProperty.all(Colors.white), + overlayColor: WidgetStateProperty.all(Colors.white.withAlpha(26)), ), ), @@ -480,6 +485,7 @@ final ThemeData themeD = ThemeData( style: ButtonStyle( backgroundColor: WidgetStateProperty.all(Color(0xFFF280A1)), foregroundColor: WidgetStateProperty.all(Colors.white), + overlayColor: WidgetStateProperty.all(Colors.white.withAlpha(26)), ), ), @@ -516,6 +522,7 @@ final ThemeData themeV = ThemeData( style: ButtonStyle( backgroundColor: WidgetStateProperty.all(Colors.blue[400]!), foregroundColor: WidgetStateProperty.all(Colors.black), + overlayColor: WidgetStateProperty.all(Colors.white.withAlpha(26)), ), ), diff --git a/lib/widgets/forgotten_password.dart b/lib/widgets/forgotten_password.dart index 5e26e25a..4ed369c5 100644 --- a/lib/widgets/forgotten_password.dart +++ b/lib/widgets/forgotten_password.dart @@ -37,16 +37,7 @@ class ForgottenPassword { ), Padding( padding: EdgeInsets.all(8.0), - child: Container( - width: 220.0, - child: Text( - contentText, - textAlign: TextAlign.center, - style: TextStyle( - //fontWeight: FontWeight.w600, - //color: Colors.black, - ), - )), + child: Text(contentText), ), Visibility( visible: notClicked, @@ -73,17 +64,9 @@ class ForgottenPassword { child: Padding( padding: const EdgeInsets.all(8.0), child: Stack(children: [ - ElevatedButton( + TextButton( key: Key('submit_btn'), - style: ElevatedButton.styleFrom( - backgroundColor: Theme.of(context).colorScheme.primary), - child: Text( - t.resetSubmit, - style: TextStyle( - fontWeight: FontWeight.w600, - color: Theme.of(context).colorScheme.onSecondary, - ), - ), + child: Text(t.resetSubmit), onPressed: () { setState(() { resetController.text.isEmpty