forked from usamaaelgendy/Ecommerce_App
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f5c2355
commit d29caad
Showing
5 changed files
with
141 additions
and
9 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,109 @@ | ||
import 'package:ecommerce_app/core/view_model/auth_view_model.dart'; | ||
import 'package:ecommerce_app/view/auth/login_view.dart'; | ||
import 'package:ecommerce_app/view/widgets/custom_buttom.dart'; | ||
import 'package:ecommerce_app/view/widgets/custom_text.dart'; | ||
import 'package:ecommerce_app/view/widgets/custom_text_form_field.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:get/get.dart'; | ||
|
||
class RegisterView extends GetWidget<AuthViewModel> { | ||
final GlobalKey<FormState> _formKey = GlobalKey<FormState>(); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
backgroundColor: Colors.white, | ||
appBar: AppBar( | ||
backgroundColor: Colors.white, | ||
elevation: 0.0, | ||
leading: GestureDetector( | ||
onTap: () { | ||
Get.off(LoginView()); | ||
}, | ||
child: Icon( | ||
Icons.arrow_back, | ||
color: Colors.black, | ||
)), | ||
), | ||
body: Padding( | ||
padding: const EdgeInsets.only( | ||
top: 50, | ||
right: 20, | ||
left: 20, | ||
), | ||
child: Form( | ||
key: _formKey, | ||
child: Column( | ||
children: [ | ||
CustomText( | ||
text: "Sign Up,", | ||
fontSize: 30, | ||
), | ||
SizedBox( | ||
height: 30, | ||
), | ||
CustomTextFormField( | ||
text: 'Name', | ||
hint: 'Pesa', | ||
onSave: (value) { | ||
controller.name = value; | ||
}, | ||
validator: (value) { | ||
if (value == null) { | ||
print("ERROR"); | ||
} | ||
}, | ||
), | ||
SizedBox( | ||
height: 30, | ||
), | ||
CustomTextFormField( | ||
text: 'Email', | ||
hint: '[email protected]', | ||
onSave: (value) { | ||
controller.email = value; | ||
}, | ||
validator: (value) { | ||
if (value == null) { | ||
print("ERROR"); | ||
} | ||
}, | ||
), | ||
SizedBox( | ||
height: 40, | ||
), | ||
CustomTextFormField( | ||
text: 'Password', | ||
hint: '**********', | ||
onSave: (value) { | ||
controller.password = value; | ||
}, | ||
validator: (value) { | ||
if (value == null) { | ||
print('error'); | ||
} | ||
}, | ||
), | ||
SizedBox( | ||
height: 15, | ||
), | ||
CustomButton( | ||
onPress: () { | ||
_formKey.currentState.save(); | ||
|
||
if (_formKey.currentState.validate()) { | ||
controller.createAccountWithEmailAndPassword(); | ||
} | ||
}, | ||
text: 'SIGN Up', | ||
), | ||
SizedBox( | ||
height: 40, | ||
), | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
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