diff --git a/lib/features/auth/presentation/screens/authentication_screen.dart b/lib/features/auth/presentation/screens/authentication_screen.dart index 7eb2acc..2b10613 100644 --- a/lib/features/auth/presentation/screens/authentication_screen.dart +++ b/lib/features/auth/presentation/screens/authentication_screen.dart @@ -15,10 +15,8 @@ class AuthenticationScreen extends StatefulWidget { } class _AuthenticationScreenState extends State { - final TextEditingController _emailController = - TextEditingController(text: 'kminchelle'); - final TextEditingController _passwordController = - TextEditingController(text: '0lelplR'); + final TextEditingController _emailController = TextEditingController(); + final TextEditingController _passwordController = TextEditingController(); @override Widget build(BuildContext context) { return Scaffold( @@ -33,11 +31,13 @@ class _AuthenticationScreenState extends State { AuthField( hintText: 'Username', controller: _emailController, + key: const Key('username-field'), ), AuthField( hintText: 'Password', controller: _passwordController, obscureText: true, + key: const Key('password-field'), ), const SizedBox(height: 16.0), BlocConsumer( @@ -72,6 +72,7 @@ class _AuthenticationScreenState extends State { height: 54.0, width: 180.0, child: ElevatedButton( + key: const Key('login-button'), style: const ButtonStyle(), onPressed: () { context.read().add( diff --git a/lib/features/auth/presentation/shared/textfield.dart b/lib/features/auth/presentation/shared/textfield.dart index e4aca52..89d5f5f 100644 --- a/lib/features/auth/presentation/shared/textfield.dart +++ b/lib/features/auth/presentation/shared/textfield.dart @@ -15,6 +15,7 @@ class AuthField extends StatelessWidget { return Padding( padding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 8.0), child: TextField( + key: key, controller: controller, obscureText: obscureText, decoration: InputDecoration(