Skip to content

Commit

Permalink
updated ui to show all the text properly (himanshusharma89#255)
Browse files Browse the repository at this point in the history
* updated ui to show all the text properly

* used variables height and width and removed any in provider

* also updated the signup with same issue
  • Loading branch information
Priyanshu078 authored Oct 28, 2021
1 parent 2957eb6 commit 17bd6ef
Show file tree
Hide file tree
Showing 2 changed files with 361 additions and 357 deletions.
330 changes: 166 additions & 164 deletions lib/views/auth/login_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,193 +48,195 @@ class LoginScreenState extends State<LoginScreen> {
child: Scaffold(
body: SafeArea(
child: Center(
child: RelicBazaarStackedView(
height: height * 0.60,
width: width * 0.87,
child: Form(
key: _formKey,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: height / 99),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Flexible(
flex: 2,
child: Text(
'Login',
style: TextStyle(
fontSize: 40,
color: Colors.white,
fontFamily: 'pix M 8pt',
fontWeight: FontWeight.bold,
child: SingleChildScrollView(
child: RelicBazaarStackedView(
height: height*0.70,
width: width*0.87,
child: Form(
key: _formKey,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: height / 99),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Flexible(
flex: 2,
child: Text(
'Login',
style: TextStyle(
fontSize: 40,
color: Colors.white,
fontFamily: 'pix M 8pt',
fontWeight: FontWeight.bold,
),
),
),
),
SizedBox(
height: height * 0.0004,
),
const Flexible(
flex: 2,
child: Text(
'Welcome back,\nPlease login to your account',
style: TextStyle(
fontSize: 20,
color: Colors.white,
fontFamily: 'pix M 8pt',
),
SizedBox(
height: height * 0.0004,
),
),
SizedBox(
height: height * 0.015,
),
Flexible(
flex: 3,
child: RelicBazaarStackedView(
height: height * 0.07,
width: width * 0.7,
child: TextFormField(
focusNode: _emailFocusNode,
keyboardType: TextInputType.emailAddress,
enabled: true,
textInputAction: TextInputAction.next,
decoration: textFieldDecoration(
hintText: 'Email Address',
const Flexible(
flex: 2,
child: Text(
'Welcome back,\nPlease login to your account',
style: TextStyle(
fontSize: 20,
color: Colors.white,
fontFamily: 'pix M 8pt',
),
onFieldSubmitted: (_) {
_emailFocusNode!.unfocus();
FocusScope.of(context)
.requestFocus(_passwordFocusNode);
},
onSaved: (String? value) {
_email = value;
},
),
),
),
SizedBox(
height: height * 0.019,
),
Flexible(
flex: 3,
child: RelicBazaarStackedView(
height: height * 0.07,
width: width * 0.7,
child: TextFormField(
focusNode: _passwordFocusNode,
keyboardType: TextInputType.visiblePassword,
obscureText: _showPassword,
enabled: true,
textInputAction: TextInputAction.done,
decoration: textFieldDecoration(
hintText: 'Password',
suffixIcon: IconButton(
icon: _showPassword
? const Icon(Icons.visibility)
: const Icon(Icons.visibility_off),
onPressed: () {
setState(
() {
_showPassword = !_showPassword;
},
);
}, //for show and hide password
SizedBox(
height: height * 0.015,
),
Flexible(
flex: 3,
child: RelicBazaarStackedView(
height: height * 0.07,
width: width * 0.7,
child: TextFormField(
focusNode: _emailFocusNode,
keyboardType: TextInputType.emailAddress,
enabled: true,
textInputAction: TextInputAction.next,
decoration: textFieldDecoration(
hintText: 'Email Address',
),
onFieldSubmitted: (_) {
_emailFocusNode!.unfocus();
FocusScope.of(context)
.requestFocus(_passwordFocusNode);
},
onSaved: (String? value) {
_email = value;
},
),
onFieldSubmitted: (_) {
_passwordFocusNode!.unfocus();
FocusScope.of(context)
.requestFocus(_loginFocusNode);
},
onSaved: (String? value) {
_password = value;
},
),
),
),
SizedBox(
height: height * 0.019,
),
Flexible(
flex: 2,
child: InkWell(
onTap: () {
_formKey.currentState!.save();
_inputValidator(
email: _email!,
password: _password,
);
},
focusNode: _loginFocusNode,
SizedBox(
height: height * 0.019,
),
Flexible(
flex: 3,
child: RelicBazaarStackedView(
upperColor: Colors.black,
lowerColor: Colors.white,
height: height * 0.065,
width: width * 0.40,
borderColor: Colors.white,
child: const Center(
child: Text(
'Login',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.white,
height: height * 0.07,
width: width * 0.7,
child: TextFormField(
focusNode: _passwordFocusNode,
keyboardType: TextInputType.visiblePassword,
obscureText: _showPassword,
enabled: true,
textInputAction: TextInputAction.done,
decoration: textFieldDecoration(
hintText: 'Password',
suffixIcon: IconButton(
icon: _showPassword
? const Icon(Icons.visibility)
: const Icon(Icons.visibility_off),
onPressed: () {
setState(
() {
_showPassword = !_showPassword;
},
);
}, //for show and hide password
),
),
onFieldSubmitted: (_) {
_passwordFocusNode!.unfocus();
FocusScope.of(context)
.requestFocus(_loginFocusNode);
},
onSaved: (String? value) {
_password = value;
},
),
),
),
),
SizedBox(
height: height * 0.04,
),
Center(
child: Column(
children: <Widget>[
InkWell(
onTap: () async {
debugPrint('Navigate to google!');
setState(() {
_loading = true;
});
final String? errorMessage =
await AuthenticationService
.signInWithGoogle();
if (errorMessage != null &&
!errorMessage.contains(
'Sign In Cancelled By User')) {
showErrorDialog(
errorMessage: errorMessage,
context: context,
);
setState(() {
_loading = false;
});
}
},
child: SizedBox(
width: 45,
height: 45,
child: Image.asset(
'assets/items/google.png',
SizedBox(
height: height * 0.019,
),
Flexible(
flex: 2,
child: InkWell(
onTap: () {
_formKey.currentState!.save();
_inputValidator(
email: _email!,
password: _password,
);
},
focusNode: _loginFocusNode,
child: RelicBazaarStackedView(
upperColor: Colors.black,
lowerColor: Colors.white,
height: height * 0.065,
width: width * 0.40,
borderColor: Colors.white,
child: const Center(
child: Text(
'Login',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
),
),
TextButton(
onPressed: () => Navigator.of(context).pushNamed(
RouteConstant.SIGN_UP_SCREEN,
),
),
SizedBox(
height: height * 0.04,
),
Center(
child: Column(
children: <Widget>[
InkWell(
onTap: () async {
debugPrint('Navigate to google!');
setState(() {
_loading = true;
});
final String? errorMessage =
await AuthenticationService
.signInWithGoogle();
if (errorMessage != null &&
!errorMessage.contains(
'Sign In Cancelled By User')) {
showErrorDialog(
errorMessage: errorMessage,
context: context,
);
setState(() {
_loading = false;
});
}
},
child: SizedBox(
width: 45,
height: 45,
child: Image.asset(
'assets/items/google.png',
),
),
),
child: const Text(
'SignUp',
style: TextStyle(
color: Colors.white,
TextButton(
onPressed: () => Navigator.of(context).pushNamed(
RouteConstant.SIGN_UP_SCREEN,
),
child: const Text(
'SignUp',
style: TextStyle(
color: Colors.white,
),
),
),
),
],
],
),
),
),
],
],
),
),
),
),
Expand Down
Loading

0 comments on commit 17bd6ef

Please sign in to comment.