-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from mdnazisharman2803/carbookingsigninScreen
Car Booking App Sign Up Screen
- Loading branch information
Showing
7 changed files
with
327 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
31
car_booking/lib/screens/signup/widget/singup_background_image.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
59
car_booking/lib/screens/signup/widget/singup_password_input.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
42
car_booking/lib/screens/signup/widget/singup_rounded_button.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
58
car_booking/lib/screens/signup/widget/singup_text_field.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |