Skip to content

Commit

Permalink
chore: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevithakannan2 committed Oct 22, 2024
1 parent 9f6ad85 commit a7b5e44
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 52 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
migrate_working_dir/
**/google-services.json
**/firebase_options.dart
firebase.json

# IntelliJ related
*.iml
Expand Down
22 changes: 2 additions & 20 deletions lib/screens/login_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,32 +113,25 @@ class _LoginScreenState extends State<LoginScreen> {
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(
color: Colors.grey[700],
fontSize: 16,
),
),

const SizedBox(height: 25),

MyTextField(
controller: _emailController,
hintText: 'Email',
obscureText: false,
),

const SizedBox(height: 10),

MyTextField(
controller: _passwordController,
hintText: 'Password',
Expand All @@ -154,9 +147,7 @@ class _LoginScreenState extends State<LoginScreen> {
},
),
),

const SizedBox(height: 10),

Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: Row(
Expand All @@ -169,21 +160,15 @@ class _LoginScreenState extends State<LoginScreen> {
],
),
),

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(
Expand All @@ -210,15 +195,12 @@ class _LoginScreenState extends State<LoginScreen> {
],
),
),

const SizedBox(height: 50),

Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
onTap:
gmailLogin,
onTap: gmailLogin,
child:
const SquareTile(imagePath: 'lib/images/google.png'),
),
Expand Down
55 changes: 27 additions & 28 deletions lib/widgets/button_widget.dart
Original file line number Diff line number Diff line change
@@ -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,
),
),
),
);
}
}
),
);
}
}
8 changes: 4 additions & 4 deletions lib/widgets/square_tile_widget.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';

class SquareTile extends StatelessWidget{
class SquareTile extends StatelessWidget {
final String imagePath;
const SquareTile({
super.key,
Expand All @@ -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(
Expand All @@ -22,4 +22,4 @@ class SquareTile extends StatelessWidget{
),
);
}
}
}

0 comments on commit a7b5e44

Please sign in to comment.