login, registration, contact us

development-design-2.0
Sikander Saleem 3 years ago
parent f9706254d5
commit e3741d5907

@ -54,85 +54,101 @@ class _ContactUsScreenState extends State<ContactUsScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isPortrait = MediaQuery.of(context).orientation == Orientation.portrait; bool isPortrait = MediaQuery.of(context).orientation == Orientation.portrait;
Widget _header = SizedBox(height: isPortrait ? null : double.infinity, width: double.infinity, child: CommonHeader("اتصل بنا", "assets/icons/new/contact_bg.jpg", Color(0xff416A6C)));
Widget _inputDataList = Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
"نسعد بتواصلكم بالمساهمة في تطوير المشروع وطرح المقترحات التي حقق جودته. الرجاء تعبئة البيانات لكي تصل إلينا بشكل مناسب، وسيتم التواصل معكم في أقرب وقت ممكن."
.toText(13, color: ColorConsts.darkText, textAlign: TextAlign.center),
32.height,
CommonTextFieldWidget(hint: "الاسم الأول", controller: _firstNameController, fillColor: Colors.white, isBorder: true),
8.height,
CommonTextFieldWidget(hint: "الاسم الأخير", controller: _lastNameController, fillColor: Colors.white, isBorder: true),
8.height,
CommonTextFieldWidget(hint: "البريد الإلكتروني", controller: _emailController, fillColor: Colors.white, isBorder: true, isEmail: true),
8.height,
CommonTextFieldWidget(hint: " رقم الاتصال${" (" + ("9xx") + " xxxxxxxxx)"}", controller: _mobileNumberController, fillColor: Colors.white, isBorder: true),
8.height,
CommonTextFieldWidget(hint: "التفاصيل", controller: _descriptionController, maxLines: 5, fillColor: Colors.white, isBorder: true),
22.height,
SizedBox(
width: double.infinity,
height: 50,
child: TextButton(
onPressed: () {
if (_firstNameController.text.length < 1) {
Utils.showToast("يرجى إدخال الاسم الأول");
return;
}
if (_lastNameController.text.length < 1) {
Utils.showToast("يرجى إدخال الاسم الأخير");
return;
}
if (_emailController.text.length < 1) {
Utils.showToast("يرجى إدخال البريد الإلكتروني");
return;
}
if (_mobileNumberController.text.length < 1) {
Utils.showToast("يرجى إدخال رقم الهاتف");
return;
}
if (_mobileNumberController.text.length != 12) {
Utils.showToast("صيغة الرقم غير صحيحة");
return;
}
if (_descriptionController.text.length < 1) {
Utils.showToast("يرجى إدخال التفاصيل");
return;
}
if (_descriptionController.text.trim().length < 1) {
Utils.showToast("يرجى إدخال التفاصيل");
return;
}
if (!_emailController.text.isValidEmail()) {
Utils.showToast("صيغة البريد الإلكتروني غير صحيحة");
return;
}
sendFeedback(_firstNameController.text, _lastNameController.text, _emailController.text, _mobileNumberController.text, _descriptionController.text);
},
style: TextButton.styleFrom(
backgroundColor: ColorConsts.darkText,
foregroundColor: Colors.white,
textStyle: TextStyle(fontSize: 18),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25.0),
),
),
child: Text("إرسال"),
),
),
],
);
return Scaffold( return Scaffold(
backgroundColor: ColorConsts.greyF4Color, backgroundColor: ColorConsts.greyF4Color,
body: SingleChildScrollView( body: isPortrait
physics: BouncingScrollPhysics(), ? SingleChildScrollView(
child: Column( physics: BouncingScrollPhysics(),
children: [ child: Column(
CommonHeader("اتصل بنا", "assets/icons/new/contact_bg.jpg", Color(0xff416A6C)), children: [
Column( _header,
crossAxisAlignment: CrossAxisAlignment.center, _inputDataList.paddingAll(35),
mainAxisSize: MainAxisSize.min, ],
),
)
: Row(
children: [ children: [
"نسعد بتواصلكم بالمساهمة في تطوير المشروع وطرح المقترحات التي حقق جودته. الرجاء تعبئة البيانات لكي تصل إلينا بشكل مناسب، وسيتم التواصل معكم في أقرب وقت ممكن." Expanded(child: _header, flex: 4),
.toText(13, color: ColorConsts.darkText, textAlign: TextAlign.center), Expanded(
32.height, child: SingleChildScrollView(
CommonTextFieldWidget(hint: "الاسم الأول", controller: _firstNameController, fillColor: Colors.white, isBorder: true), physics: BouncingScrollPhysics(),
8.height, padding: EdgeInsets.all(36),
CommonTextFieldWidget(hint: "الاسم الأخير", controller: _lastNameController, fillColor: Colors.white, isBorder: true), child: _inputDataList,
8.height,
CommonTextFieldWidget(hint: "البريد الإلكتروني", controller: _emailController, fillColor: Colors.white, isBorder: true, isEmail: true),
8.height,
CommonTextFieldWidget(hint: " رقم الاتصال${" (" + ("9xx") + " xxxxxxxxx)"}", controller: _mobileNumberController, fillColor: Colors.white, isBorder: true),
8.height,
CommonTextFieldWidget(hint: "التفاصيل", controller: _descriptionController, maxLines: 5, fillColor: Colors.white, isBorder: true),
22.height,
SizedBox(
width: double.infinity,
height: 50,
child: TextButton(
onPressed: () {
if (_firstNameController.text.length < 1) {
Utils.showToast("يرجى إدخال الاسم الأول");
return;
}
if (_lastNameController.text.length < 1) {
Utils.showToast("يرجى إدخال الاسم الأخير");
return;
}
if (_emailController.text.length < 1) {
Utils.showToast("يرجى إدخال البريد الإلكتروني");
return;
}
if (_mobileNumberController.text.length < 1) {
Utils.showToast("يرجى إدخال رقم الهاتف");
return;
}
if (_mobileNumberController.text.length != 12) {
Utils.showToast("صيغة الرقم غير صحيحة");
return;
}
if (_descriptionController.text.length < 1) {
Utils.showToast("يرجى إدخال التفاصيل");
return;
}
if (_descriptionController.text.trim().length < 1) {
Utils.showToast("يرجى إدخال التفاصيل");
return;
}
if (!_emailController.text.isValidEmail()) {
Utils.showToast("صيغة البريد الإلكتروني غير صحيحة");
return;
}
sendFeedback(_firstNameController.text, _lastNameController.text, _emailController.text, _mobileNumberController.text, _descriptionController.text);
},
style: TextButton.styleFrom(
backgroundColor: ColorConsts.darkText,
foregroundColor: Colors.white,
textStyle: TextStyle(fontSize: 18),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25.0),
),
), ),
child: Text("إرسال"), flex: 6)
),
),
], ],
).paddingAll(35), ),
],
),
),
); );
} }
} }

@ -86,6 +86,88 @@ class _LoginScreenState extends State<LoginScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isPortrait = MediaQuery.of(context).orientation == Orientation.portrait; bool isPortrait = MediaQuery.of(context).orientation == Orientation.portrait;
Widget _options = Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisSize: MainAxisSize.min,
children: [
InkWell(
onTap: () {
setState(() {
_isRemember = !_isRemember;
});
},
child: Icon(_isRemember ? Icons.check_box_rounded : Icons.check_box_outline_blank_rounded, color: ColorConsts.borderDark2Text, size: 17),
//child: SvgPicture.asset(_isAccept ? "assets/icons/checkOn.svg" : "assets/icons/checkOff.svg", width: 16, height: 16,color: ColorConsts.borderDarkText),
),
10.width,
"تذكرني".toText(14),
],
),
"هل نسيت كلمة المرور؟".toText(14).onPress(() {
Navigator.pushNamed(context, ForgotPasswordScreen.routeName);
})
],
);
Widget _loginButton = SizedBox(
width: double.infinity,
height: isPortrait ? 50 : 45,
child: TextButton(
onPressed: () {
if (_emailController.text.length < 1) {
Utils.showToast("يرجى إدخال البريد الإلكتروني");
return;
} else if (!_emailController.text.isValidEmail()) {
Utils.showToast("صيغة البريد الإلكتروني خاطئة");
return;
}
if (_passwordController.text.length < 1) {
Utils.showToast("يرجى إدخال كلمة المرور");
return;
}
performLogin(_emailController.text, _passwordController.text);
},
style: TextButton.styleFrom(
backgroundColor: ColorConsts.brownLightColor,
foregroundColor: Colors.white,
textStyle: TextStyle(fontSize: 18),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
),
child: Text("تسجيل الدخول"),
),
);
Widget _registrationButton = SizedBox(
width: double.infinity,
height: isPortrait ? 48 : 32,
child: TextButton(
onPressed: () {
Navigator.pushNamed(context, RegistrationScreen.routeName);
},
style: TextButton.styleFrom(
backgroundColor: Colors.transparent,
foregroundColor: Colors.white,
padding: EdgeInsets.zero,
textStyle: TextStyle(fontSize: isPortrait ? 18 : 16),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0), side: BorderSide(color: Colors.white, width: 1)),
),
child: Text("إنشاء حساب جديد"),
),
);
Widget _registrationText = Row(
children: [
Divider(height: 1, color: Colors.white).expanded,
"ليس لديك حساب؟".toText(14).paddingOnly(left: 24, right: 24),
Divider(height: 1, color: Colors.white).expanded,
],
);
return Scaffold( return Scaffold(
backgroundColor: ColorConsts.darkText, backgroundColor: ColorConsts.darkText,
body: SafeArea( body: SafeArea(
@ -98,95 +180,48 @@ class _LoginScreenState extends State<LoginScreen> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Image.asset("assets/icons/new/Tangeem-logo-W.png", width: 136, height: 74), Image.asset("assets/icons/new/Tangeem-logo-W.png", width: isPortrait ? 136 : 100, height: 74),
50.height, isPortrait ? 50.height : 0.height,
"تسجيل الدخول".toText(18), "تسجيل الدخول".toText(isPortrait ? 18 : 20),
32.height, 32.height,
LoginTextFieldWidget(hint: "البريد الإلكتروني", controller: _emailController, iconData: Icons.email_rounded), if (isPortrait) ...[
20.height, LoginTextFieldWidget(hint: "البريد الإلكتروني", controller: _emailController, iconData: Icons.email_rounded),
LoginTextFieldWidget(hint: "كلمة المرور", controller: _passwordController, iconData: Icons.lock_rounded, isPassword: true), 20.height,
20.height, LoginTextFieldWidget(hint: "كلمة المرور", controller: _passwordController, iconData: Icons.lock_rounded, isPassword: true),
Row( 20.height,
crossAxisAlignment: CrossAxisAlignment.center, _options,
mainAxisAlignment: MainAxisAlignment.spaceBetween, 20.height,
children: [ _loginButton,
Row( 20.height,
mainAxisSize: MainAxisSize.min, _registrationText,
children: [ 20.height,
InkWell( _registrationButton,
onTap: () { 46.height,
setState(() { ] else ...[
_isRemember = !_isRemember; Row(
}); children: [
}, Column(
child: Icon(_isRemember ? Icons.check_box_rounded : Icons.check_box_outline_blank_rounded, color: ColorConsts.borderDark2Text, size: 17), children: [
//child: SvgPicture.asset(_isAccept ? "assets/icons/checkOn.svg" : "assets/icons/checkOff.svg", width: 16, height: 16,color: ColorConsts.borderDarkText), LoginTextFieldWidget(hint: "البريد الإلكتروني", controller: _emailController, iconData: Icons.email_rounded),
), 20.height,
10.width, LoginTextFieldWidget(hint: "كلمة المرور", controller: _passwordController, iconData: Icons.lock_rounded, isPassword: true),
"تذكرني".toText(14), ],
], ).expanded,
), 24.width,
"هل نسيت كلمة المرور؟".toText(14).onPress(() { Column(
Navigator.pushNamed(context, ForgotPasswordScreen.routeName); children: [
}) _loginButton,
], 14.height,
), _registrationText,
20.height, 10.height,
SizedBox( _registrationButton,
width: double.infinity, ],
height: 50, ).expanded
child: TextButton( ],
onPressed: () { ).paddingOnly(left: 42, right: 42),
if (_emailController.text.length < 1) { 16.height,
Utils.showToast("يرجى إدخال البريد الإلكتروني"); _options.paddingOnly(left: 42, right: 42),
return; ],
} else if (!_emailController.text.isValidEmail()) {
Utils.showToast("صيغة البريد الإلكتروني خاطئة");
return;
}
if (_passwordController.text.length < 1) {
Utils.showToast("يرجى إدخال كلمة المرور");
return;
}
performLogin(_emailController.text, _passwordController.text);
},
style: TextButton.styleFrom(
backgroundColor: ColorConsts.brownLightColor,
foregroundColor: Colors.white,
textStyle: TextStyle(fontSize: 18),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
),
child: Text("تسجيل الدخول"),
),
),
20.height,
Row(
children: [
Divider(height: 1, color: Colors.white).expanded,
"ليس لديك حساب؟".toText(14).paddingOnly(left: 24, right: 24),
Divider(height: 1, color: Colors.white).expanded,
],
),
20.height,
SizedBox(
width: double.infinity,
height: 48,
child: TextButton(
onPressed: () {
Navigator.pushNamed(context, RegistrationScreen.routeName);
},
style: TextButton.styleFrom(
backgroundColor: Colors.transparent,
foregroundColor: Colors.white,
textStyle: TextStyle(fontSize: 18),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0), side: BorderSide(color: Colors.white, width: 1)),
),
child: Text("إنشاء حساب جديد"),
),
),
46.height,
Column( Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [

@ -88,161 +88,205 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( bool isPortrait = MediaQuery.of(context).orientation == Orientation.portrait;
backgroundColor: ColorConsts.greyF8Color,
body: SingleChildScrollView( Widget _header = Column(
padding: EdgeInsets.only(top: 100, bottom: 24), mainAxisSize: MainAxisSize.min,
physics: BouncingScrollPhysics(), children: [
child: Column( Padding(
padding: EdgeInsets.only(top: 35, bottom: 24),
child: SvgPicture.asset("assets/logos/tangheem_logo.svg", width: 72, height: 72),
),
"انشاء حساب جديد".toText(18, color: ColorConsts.darkText),
],
);
Widget _dataInput = Column(
mainAxisSize: MainAxisSize.min,
children: [
CommonTextFieldWidget(hint: "البريد الإلكتروني", controller: _emailController, isEmail: true),
SizedBox(height: 8),
CommonTextFieldWidget(hint: "الاسم الأول", controller: _firstNameController),
SizedBox(height: 8),
CommonTextFieldWidget(hint: "الاسم الأخير", controller: _lastNameController),
SizedBox(height: 8),
CommonTextFieldWidget(
hint: _selectedCountry?.countryNameAr ?? "الدولة",
controller: null,
suffixWidget: Icon(Icons.keyboard_arrow_down, size: 18, color: ColorConsts.secondaryOrange),
onTap: () {
_selectCountry(context);
},
),
SizedBox(height: 8),
CommonTextFieldWidget(
hint: " رقم الجوال (اختياري)${" (" + (_selectedCountry?.countryCode ?? "+9xx") + " xxxxxxxxx)"}",
controller: _mobileNumberController,
suffixWidget: Text(_selectedCountry?.countryCode ?? "", textDirection: TextDirection.ltr),
),
SizedBox(height: 8),
CommonTextFieldWidget(hint: "تعيين كلمة المرور", controller: _passwordController),
SizedBox(height: 8),
CommonTextFieldWidget(hint: "تأكيد كلمة المرور", controller: _confirmPasswordController),
Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Image.asset("assets/icons/new/Tangeem-logo.png", width: 116, height: 62), Icon(_isAccept ? Icons.check_box_rounded : Icons.check_box_outline_blank_rounded, color: ColorConsts.borderDark2Text, size: 17),
30.height, SizedBox(width: 8),
Container( "جميع البيانات صحيحة ضمن اتفاقية الاستخدام".toText(14, color: ColorConsts.darkText).expanded,
width: MediaQuery.of(context).size.width, ],
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.0), color: Colors.white), ).onPress(() {
margin: EdgeInsets.only(left: 24, right: 24, top: 24, bottom: 20), setState(() {
_isAccept = !_isAccept;
});
}).paddingOnly(top: 24, bottom: 24, left: 16, right: 16),
],
);
List<Widget> _dataList = [
_header,
"قم بتعبئة بيانات طلب انشاء الحساب و ستصلك رسالة تأكيد, ومن ثم يمكنك الدخول لحسابك الجديد"
.toText(13, color: ColorConsts.grey9FColor, textAlign: TextAlign.center)
.paddingOnly(left: 24, right: 24, top: 18, bottom: 18),
_dataInput.paddingOnly(left: 12, right: 12),
];
Widget _registrationButton = SizedBox(
width: double.infinity,
height: 50,
child: TextButton(
onPressed: () {
if (_emailController.text.length < 1) {
Utils.showToast("يرجى إدخال البريد الإلكتروني");
return;
}
if (_firstNameController.text.length < 1) {
Utils.showToast("يرجى إدخال الاسم الأول");
return;
}
if (_lastNameController.text.length < 1) {
Utils.showToast("يرجى إدخال الاسم الأخير");
return;
}
if (_selectedCountry?.countryCode == null) {
Utils.showToast("يرجى اختيار الدولة");
return;
}
// if (_mobileNumberController.text.length < 1) {
// Utils.showToast("يرجى إدخال رقم الجوال");
// return;
// } else
if (_mobileNumberController.text.isNotEmpty && (_mobileNumberController.text.length < 8 || _mobileNumberController.text.length > 12)) {
Utils.showToast("رقم الهاتف غير صحيح");
return;
}
if (_passwordController.text.length < 1) {
Utils.showToast("يرجى إدخال كلمة المرور");
return;
}
if (_confirmPasswordController.text.length < 1) {
Utils.showToast("يرجى تأكيد كلمة المرور");
return;
}
if (!_emailController.text.isValidEmail()) {
Utils.showToast("صيغة البريد الإلكتروني خاطئة");
return;
}
if (_passwordController.text != _confirmPasswordController.text) {
Utils.showToast("كلمة المرور غير متطابقة");
return;
}
if (!_isAccept) {
Utils.showToast("الرجاء الموافقة على سياسة الخصوصية");
return;
}
registerUser(_firstNameController.text, _lastNameController.text, _emailController.text, _passwordController.text, _selectedCountry?.countryCode, _mobileNumberController.text);
},
style: TextButton.styleFrom(
backgroundColor: ColorConsts.darkText,
foregroundColor: Colors.white,
textStyle: TextStyle(fontSize: 18),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25.0),
),
),
child: Text("انشئ حسابك"),
),
);
Widget _contactUsButton = Column(
mainAxisSize: MainAxisSize.min,
children: [
SvgPicture.asset("assets/icons/new/contact_us.svg", width: 26, height: 24, color: ColorConsts.greyC4Color),
8.height,
"اتصل بنا".toText(14, color: ColorConsts.greyC4Color),
],
).onPress(() {
Navigator.pushNamed(context, ContactUsScreen.routeName);
});
return isPortrait
? Scaffold(
backgroundColor: ColorConsts.greyF8Color,
body: SingleChildScrollView(
padding: EdgeInsets.only(top: 100, bottom: 24),
physics: BouncingScrollPhysics(),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Padding( Image.asset("assets/icons/new/Tangeem-logo.png", width: 116, height: 62),
padding: EdgeInsets.only(top: 35, bottom: 24), 30.height,
child: SvgPicture.asset("assets/logos/tangheem_logo.svg", width: 72, height: 72), Container(
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.0), color: Colors.white),
margin: EdgeInsets.only(left: 24, right: 24, top: 24, bottom: 20),
child: Column(crossAxisAlignment: CrossAxisAlignment.center, mainAxisSize: MainAxisSize.min, children: _dataList),
), ),
"انشاء حساب جديد".toText(18, color: ColorConsts.darkText), _registrationButton.paddingOnly(left: 35, right: 35, bottom: 35),
"قم بتعبئة بيانات طلب انشاء الحساب و ستصلك رسالة تأكيد, ومن ثم يمكنك الدخول لحسابك الجديد" _contactUsButton,
.toText(13, color: ColorConsts.grey9FColor, textAlign: TextAlign.center)
.paddingOnly(left: 24, right: 24, top: 18, bottom: 18),
Column(
mainAxisSize: MainAxisSize.min,
children: [
CommonTextFieldWidget(hint: "البريد الإلكتروني", controller: _emailController, isEmail: true),
SizedBox(height: 8),
CommonTextFieldWidget(hint: "الاسم الأول", controller: _firstNameController),
SizedBox(height: 8),
CommonTextFieldWidget(hint: "الاسم الأخير", controller: _lastNameController),
SizedBox(height: 8),
CommonTextFieldWidget(
hint: _selectedCountry?.countryNameAr ?? "الدولة",
controller: null,
suffixWidget: Icon(Icons.keyboard_arrow_down, size: 18, color: ColorConsts.secondaryOrange),
onTap: () {
_selectCountry(context);
},
),
SizedBox(height: 8),
CommonTextFieldWidget(
hint: " رقم الجوال (اختياري)${" (" + (_selectedCountry?.countryCode ?? "+9xx") + " xxxxxxxxx)"}",
controller: _mobileNumberController,
suffixWidget: Text(_selectedCountry?.countryCode ?? "", textDirection: TextDirection.ltr),
),
SizedBox(height: 8),
CommonTextFieldWidget(hint: "تعيين كلمة المرور", controller: _passwordController),
SizedBox(height: 8),
CommonTextFieldWidget(hint: "تأكيد كلمة المرور", controller: _confirmPasswordController),
Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
InkWell(
onTap: () {
setState(() {
_isAccept = !_isAccept;
});
},
child: Icon(_isAccept ? Icons.check_box_rounded : Icons.check_box_outline_blank_rounded, color: ColorConsts.borderDark2Text, size: 17),
//child: SvgPicture.asset(_isAccept ? "assets/icons/checkOn.svg" : "assets/icons/checkOff.svg", width: 16, height: 16,color: ColorConsts.borderDarkText),
),
SizedBox(width: 8),
"جميع البيانات صحيحة ضمن اتفاقية الاستخدام".toText(14, color: ColorConsts.darkText).expanded,
],
).paddingOnly(left: 30, right: 30, top: 30, bottom: 26),
],
).paddingOnly(left: 12, right: 12),
], ],
), ),
), ),
SizedBox( )
width: double.infinity, : Row(
height: 50, children: [
child: TextButton( Expanded(child: Image.asset("assets/icons/new/Tangeem-logo.png", width: 116, height: 62).paddingOnly(right: 70), flex: 3),
onPressed: () { Expanded(
if (_emailController.text.length < 1) { child: Container(
Utils.showToast("يرجى إدخال البريد الإلكتروني"); width: MediaQuery.of(context).size.width,
return; decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.0), color: Colors.white),
} margin: EdgeInsets.all(24),
if (_firstNameController.text.length < 1) { child: Row(
Utils.showToast("يرجى إدخال الاسم الأول"); crossAxisAlignment: CrossAxisAlignment.start,
return; mainAxisSize: MainAxisSize.min,
} children: [
if (_lastNameController.text.length < 1) { Expanded(child: _header, flex: 2),
Utils.showToast("يرجى إدخال الاسم الأخير"); Expanded(
return; child: SingleChildScrollView(
} padding: EdgeInsets.all(24),
if (_selectedCountry?.countryCode == null) { child: Column(
Utils.showToast("يرجى اختيار الدولة"); mainAxisSize: MainAxisSize.min,
return; children: [
} "قم بتعبئة بيانات طلب انشاء الحساب و ستصلك رسالة تأكيد, ومن ثم يمكنك الدخول لحسابك الجديد".toText(14, color: ColorConsts.grey9FColor, textAlign: TextAlign.center),
// if (_mobileNumberController.text.length < 1) { 24.height,
// Utils.showToast("يرجى إدخال رقم الجوال"); _dataInput,
// return; _registrationButton,
// } else 24.height,
_contactUsButton,
if (_mobileNumberController.text.isNotEmpty && (_mobileNumberController.text.length < 8 || _mobileNumberController.text.length > 12)) { ],
Utils.showToast("رقم الهاتف غير صحيح"); ),
return; ),
} flex: 4),
if (_passwordController.text.length < 1) { ],
Utils.showToast("يرجى إدخال كلمة المرور"); ),
return;
}
if (_confirmPasswordController.text.length < 1) {
Utils.showToast("يرجى تأكيد كلمة المرور");
return;
}
if (!_emailController.text.isValidEmail()) {
Utils.showToast("صيغة البريد الإلكتروني خاطئة");
return;
}
if (_passwordController.text != _confirmPasswordController.text) {
Utils.showToast("كلمة المرور غير متطابقة");
return;
}
if (!_isAccept) {
Utils.showToast("الرجاء الموافقة على سياسة الخصوصية");
return;
}
registerUser(_firstNameController.text, _lastNameController.text, _emailController.text, _passwordController.text, _selectedCountry?.countryCode, _mobileNumberController.text);
},
style: TextButton.styleFrom(
backgroundColor: ColorConsts.darkText,
foregroundColor: Colors.white,
textStyle: TextStyle(fontSize: 18),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(25.0),
), ),
), flex: 7),
child: Text("انشئ حسابك"), ],
), );
).paddingOnly(left: 35, right: 35, bottom: 35),
Column(
mainAxisSize: MainAxisSize.min,
children: [
SvgPicture.asset("assets/icons/new/contact_us.svg", width: 26, height: 24, color: ColorConsts.greyC4Color),
8.height,
"اتصل بنا".toText(14, color: ColorConsts.greyC4Color),
],
).onPress(() {
Navigator.pushNamed(context, ContactUsScreen.routeName);
})
],
),
),
);
} }
void _selectCountry(context) { void _selectCountry(context) {

@ -13,6 +13,8 @@ class LoginTextFieldWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isPortrait = MediaQuery.of(context).orientation == Orientation.portrait;
return isForChangePassword return isForChangePassword
? SizedBox( ? SizedBox(
height: 45, height: 45,
@ -71,7 +73,7 @@ class LoginTextFieldWidget extends StatelessWidget {
maxLines: 1, maxLines: 1,
scrollPhysics: BouncingScrollPhysics(), scrollPhysics: BouncingScrollPhysics(),
decoration: InputDecoration( decoration: InputDecoration(
contentPadding: EdgeInsets.only(top: 19, bottom: 19, right: 32, left: 4), contentPadding: EdgeInsets.only(top: isPortrait ? 19 : 0, bottom: isPortrait ? 19 : 0, right: 32, left: 4),
alignLabelWithHint: true, alignLabelWithHint: true,
fillColor: Color(0xff598A8D), fillColor: Color(0xff598A8D),
filled: true, filled: true,

Loading…
Cancel
Save