Skip to content

Commit

Permalink
Merge pull request #104 from mdnazisharman2803/carbookingsigninScreen
Browse files Browse the repository at this point in the history
Car Booking App Sign Up Screen
  • Loading branch information
Jaideep25-tech authored May 28, 2022
2 parents 2630fcc + 015b700 commit 07ea992
Show file tree
Hide file tree
Showing 7 changed files with 327 additions and 5 deletions.
6 changes: 3 additions & 3 deletions car_booking/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

import 'screens/login/login_screen.dart';

import 'screens/signup/singup_screen.dart';



Expand All @@ -27,8 +27,8 @@ class MyApp extends StatelessWidget {
initialRoute: '/',
routes: {
'/': (context) => LoginScreen(),


'CreateNewAccount': (context) => CreateNewAccount(),
},
);
}
Expand Down
5 changes: 3 additions & 2 deletions car_booking/lib/screens/login/login_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class LoginScreen extends StatelessWidget {
),
LoginRoundedButton(buttonName: 'SignIn',
onTap: () {

Navigator.pushNamed(context, 'AvailableCarScreen');
},

),
Expand All @@ -83,7 +83,8 @@ class LoginScreen extends StatelessWidget {
style: kBodyText,
),
GestureDetector(
onTap: () {},
onTap: () =>
Navigator.pushNamed(context, 'CreateNewAccount'),
child: Text(
'SignUp',
style: kBodyText.copyWith(
Expand Down
131 changes: 131 additions & 0 deletions car_booking/lib/screens/signup/singup_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'widget/singup_background_image.dart';
import 'widget/singup_password_input.dart';
import 'widget/singup_rounded_button.dart';
import 'widget/singup_text_field.dart';



class CreateNewAccount extends StatelessWidget {
@override
static const TextStyle kBodyText =
TextStyle(fontSize: 22, color: Colors.white, height: 1.5);

static const Color kWhite = Colors.white;
static const Color kBlue = Color(0xFF40ac9c);

Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return Stack(
children: [
SingupBackgroundImage(image: 'assets/images/logo.jpg'),
Scaffold(
backgroundColor: Colors.transparent,
body: SingleChildScrollView(
child: Column(
children: [
SizedBox(
height: size.width * 0.1,
),
Stack(
children: [
Center(
child: Text(
'Book Your Ride',
style: TextStyle(
color: Colors.white,
fontSize: 40,
fontWeight: FontWeight.bold),
),
),
Positioned(
top: size.height * 0.08,
left: size.width * 0.56,
child: Container(
height: size.width * 0.1,
width: size.width * 0.1,
decoration: BoxDecoration(
color: kBlue,
shape: BoxShape.circle,
border: Border.all(color: kWhite, width: 2),
),
child: Icon(
FontAwesomeIcons.arrowUp,
color: kWhite,
),
),
)
],
),
SizedBox(
height: size.width * 0.1,
),
Column(
children: [
SingupTextInputField(
icon: FontAwesomeIcons.user,
hint: 'Username',
inputType: TextInputType.name,
inputAction: TextInputAction.next,
),
SingupTextInputField(
icon: FontAwesomeIcons.envelope,
hint: 'Email',
inputType: TextInputType.emailAddress,
inputAction: TextInputAction.next,
),
SingupPasswordInput(
icon: FontAwesomeIcons.lock,
hint: 'Password',
inputAction: TextInputAction.next,
),
SingupPasswordInput(
icon: FontAwesomeIcons.lock,
hint: 'Confirm Password',
inputAction: TextInputAction.done,
),
SizedBox(
height: 25,
),
SingupRoundedButton(buttonName: 'SignUp',
onTap: () {
Navigator.pushNamed(context, 'AvailableCarScreen');
},
),
SizedBox(
height: 30,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Already have an account? ',
style: kBodyText,
),
GestureDetector(
onTap: () {
Navigator.pushNamed(context, '/');
},
child: Text(
'SignIn',
style: kBodyText.copyWith(
color: kBlue, fontWeight: FontWeight.bold),
),
),
],
),
SizedBox(
height: 20,
),
],
)
],
),
),
)
],
);
}
}
31 changes: 31 additions & 0 deletions car_booking/lib/screens/signup/widget/singup_background_image.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import 'package:flutter/material.dart';

class SingupBackgroundImage extends StatelessWidget {
const SingupBackgroundImage({
Key? key,
required this.image,
}) : super(key: key);

final String image;

@override
Widget build(BuildContext context) {
return ShaderMask(
shaderCallback: (rect) => LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.center,
colors: [Color(0xFF40ac9c), Color(0xFF40ac9c)],
).createShader(rect),
blendMode: BlendMode.darken,
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(image),
fit: BoxFit.cover,
colorFilter: ColorFilter.mode(Color.fromARGB(137, 27, 27, 27), BlendMode.darken),
),
),
),
);
}
}
59 changes: 59 additions & 0 deletions car_booking/lib/screens/signup/widget/singup_password_input.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import 'package:flutter/material.dart';


class SingupPasswordInput extends StatelessWidget {
const SingupPasswordInput({

required this.icon,
required this.hint,
this.inputType,
this.inputAction,
});

final IconData icon;
final String hint;
final TextInputType? inputType;
final TextInputAction? inputAction;

@override
static const TextStyle kBodyText =
TextStyle(fontSize: 22, color: Colors.white, height: 1.5);

static const Color kWhite = Colors.white;
static const Color kBlue = Color(0xFF40ac9c);
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return Padding(
padding: const EdgeInsets.symmetric(vertical: 10.0),
child: Container(
height: size.height * 0.08,
width: size.width * 0.8,
decoration: BoxDecoration(
color: const Color(0xFF40ac9c).withOpacity(0.5),
borderRadius: BorderRadius.circular(16),
),
child: Center(
child: TextField(
decoration: InputDecoration(
border: InputBorder.none,
prefixIcon: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0),
child: Icon(
icon,
size: 28,
color: kWhite,
),
),
hintText: hint,
hintStyle: kBodyText,
),
obscureText: true,
style: kBodyText,
keyboardType: inputType,
textInputAction: inputAction,
),
),
),
);
}
}
42 changes: 42 additions & 0 deletions car_booking/lib/screens/signup/widget/singup_rounded_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import 'package:flutter/material.dart';


class SingupRoundedButton extends StatelessWidget {
const SingupRoundedButton({
required this.onTap,
required this.buttonName,
});
final VoidCallback onTap;
final String buttonName;

@override
static const TextStyle kBodyText =
TextStyle(fontSize: 22, color: Colors.white, height: 1.5);

static const Color kWhite = Colors.white;
static const Color kBlue = Color(0xFF40ac9c);
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return Container(
height: size.height * 0.08,
width: size.width * 0.8,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
color: kBlue,
),

child:



TextButton(

onPressed: onTap,
child: Text(
buttonName,
style: kBodyText.copyWith(fontWeight: FontWeight.bold),
),
),
);
}
}
58 changes: 58 additions & 0 deletions car_booking/lib/screens/signup/widget/singup_text_field.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import 'package:flutter/material.dart';


class SingupTextInputField extends StatelessWidget {
const SingupTextInputField({
Key? key,
required this.icon,
required this.hint,
this.inputType,
this.inputAction,
}) : super(key: key);

final IconData icon;
final String hint;
final TextInputType? inputType;
final TextInputAction? inputAction;

@override
static const TextStyle kBodyText =
TextStyle(fontSize: 22, color: Colors.white, height: 1.5);

static const Color kWhite = Colors.white;
static const Color kBlue = Color(0xFF40ac9c);
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
return Padding(
padding: const EdgeInsets.symmetric(vertical: 10.0),
child: Container(
height: size.height * 0.08,
width: size.width * 0.8,
decoration: BoxDecoration(
color: const Color(0xFF40ac9c).withOpacity(0.5),
borderRadius: BorderRadius.circular(16),
),
child: Center(
child: TextField(
decoration: InputDecoration(
border: InputBorder.none,
prefixIcon: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0),
child: Icon(
icon,
size: 28,
color: kWhite,
),
),
hintText: hint,
hintStyle: kBodyText,
),
style: kBodyText,
keyboardType: inputType,
textInputAction: inputAction,
),
),
),
);
}
}

0 comments on commit 07ea992

Please sign in to comment.