diff --git a/.gitignore b/.gitignore index 40721a7..8e106fc 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ migrate_working_dir/ **/google-services.json **/firebase_options.dart +firebase.json # IntelliJ related *.iml diff --git a/lib/screens/login_screen.dart b/lib/screens/login_screen.dart index 57bb813..587a6c8 100644 --- a/lib/screens/login_screen.dart +++ b/lib/screens/login_screen.dart @@ -113,14 +113,11 @@ class _LoginScreenState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ const SizedBox(height: 50), - const Icon( Icons.lock, size: 100, ), - const SizedBox(height: 50), - Text( 'Welcome back you\'ve been missed!', style: TextStyle( @@ -128,17 +125,13 @@ class _LoginScreenState extends State { fontSize: 16, ), ), - const SizedBox(height: 25), - MyTextField( controller: _emailController, hintText: 'Email', obscureText: false, ), - const SizedBox(height: 10), - MyTextField( controller: _passwordController, hintText: 'Password', @@ -154,9 +147,7 @@ class _LoginScreenState extends State { }, ), ), - const SizedBox(height: 10), - Padding( padding: const EdgeInsets.symmetric(horizontal: 25.0), child: Row( @@ -169,21 +160,15 @@ class _LoginScreenState extends State { ], ), ), - const SizedBox(height: 25), - MyButton( onTap: signUserIn, ), - if (_errorMessage != null) ...[ const SizedBox(height: 20), - buildErrorMessage( - _errorMessage!), + buildErrorMessage(_errorMessage!), ], - const SizedBox(height: 50), - Padding( padding: const EdgeInsets.symmetric(horizontal: 25.0), child: Row( @@ -210,15 +195,12 @@ class _LoginScreenState extends State { ], ), ), - const SizedBox(height: 50), - Row( mainAxisAlignment: MainAxisAlignment.center, children: [ GestureDetector( - onTap: - gmailLogin, + onTap: gmailLogin, child: const SquareTile(imagePath: 'lib/images/google.png'), ), diff --git a/lib/widgets/button_widget.dart b/lib/widgets/button_widget.dart index 0396f98..70712ce 100644 --- a/lib/widgets/button_widget.dart +++ b/lib/widgets/button_widget.dart @@ -1,32 +1,31 @@ - import 'package:flutter/material.dart'; +import 'package:flutter/material.dart'; - class MyButton extends StatelessWidget { +class MyButton extends StatelessWidget { + final Function()? onTap; + const MyButton({super.key, required this.onTap}); - final Function()? onTap; - const MyButton({super.key,required this.onTap}); - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: onTap, - child: Container( - padding: const EdgeInsets.all(25), - margin: const EdgeInsets.symmetric(horizontal: 25), - decoration: BoxDecoration( - color: Colors.black, - borderRadius: BorderRadius.circular(8), - ), - child: const Center( - child: Text( - "Sign In", - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ), + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + child: Container( + padding: const EdgeInsets.all(25), + margin: const EdgeInsets.symmetric(horizontal: 25), + decoration: BoxDecoration( + color: Colors.black, + borderRadius: BorderRadius.circular(8), + ), + child: const Center( + child: Text( + "Sign In", + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 16, + ), ), ), - ); - } - } \ No newline at end of file + ), + ); + } +} diff --git a/lib/widgets/square_tile_widget.dart b/lib/widgets/square_tile_widget.dart index a0db087..c293b89 100644 --- a/lib/widgets/square_tile_widget.dart +++ b/lib/widgets/square_tile_widget.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -class SquareTile extends StatelessWidget{ +class SquareTile extends StatelessWidget { final String imagePath; const SquareTile({ super.key, @@ -12,8 +12,8 @@ class SquareTile extends StatelessWidget{ return Container( padding: const EdgeInsets.all(20), decoration: BoxDecoration( - border: Border.all(color: Colors.white), - borderRadius: BorderRadius.circular(16), + border: Border.all(color: Colors.white), + borderRadius: BorderRadius.circular(16), color: Colors.grey[200], ), child: Image.asset( @@ -22,4 +22,4 @@ class SquareTile extends StatelessWidget{ ), ); } -} \ No newline at end of file +}