term and condition text change & phone number validation added on registration screen.

development
Sikander Saleem 3 years ago
parent 40037e0c7e
commit c795faed99

@ -167,7 +167,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
SizedBox(width: 8), SizedBox(width: 8),
Expanded( Expanded(
child: Text( child: Text(
"أقر بأني إطلعت على شروط الاستخدام و سياسية الخصوصية و أوافق عليها", "أقر بأن جميع البيانات المدخلة أعلاه صحيحة",
style: TextStyle(color: Colors.white, fontSize: 13), style: TextStyle(color: Colors.white, fontSize: 13),
), ),
), ),
@ -179,6 +179,10 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
height: 50, height: 50,
child: TextButton( child: TextButton(
onPressed: () { onPressed: () {
if (_emailController.text.length < 1) {
Utils.showToast("يرجى إدخال البريد الإلكتروني");
return;
}
if (_firstNameController.text.length < 1) { if (_firstNameController.text.length < 1) {
Utils.showToast("يرجى إدخال الاسم الأول"); Utils.showToast("يرجى إدخال الاسم الأول");
return; return;
@ -187,10 +191,6 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
Utils.showToast("يرجى إدخال الاسم الأخير"); Utils.showToast("يرجى إدخال الاسم الأخير");
return; return;
} }
if (_emailController.text.length < 1) {
Utils.showToast("يرجى إدخال البريد الإلكتروني");
return;
}
if (_selectedCountry?.countryCode == null) { if (_selectedCountry?.countryCode == null) {
Utils.showToast("يرجى اختيار الدولة"); Utils.showToast("يرجى اختيار الدولة");
return; return;
@ -198,6 +198,9 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
if (_mobileNumberController.text.length < 1) { if (_mobileNumberController.text.length < 1) {
Utils.showToast("يرجى إدخال رقم الجوال"); Utils.showToast("يرجى إدخال رقم الجوال");
return; return;
} else if (_mobileNumberController.text.length < 8 || _mobileNumberController.text.length > 12) {
Utils.showToast("رقم الهاتف غير صحيح");
return;
} }
if (_passwordController.text.length < 1) { if (_passwordController.text.length < 1) {
Utils.showToast("يرجى إدخال كلمة المرور"); Utils.showToast("يرجى إدخال كلمة المرور");
@ -226,8 +229,8 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
_firstNameController.text, _lastNameController.text, _emailController.text, _passwordController.text, _selectedCountry?.countryCode, _mobileNumberController.text); _firstNameController.text, _lastNameController.text, _emailController.text, _passwordController.text, _selectedCountry?.countryCode, _mobileNumberController.text);
}, },
style: TextButton.styleFrom( style: TextButton.styleFrom(
primary: Colors.white,
backgroundColor: ColorConsts.secondaryPink, backgroundColor: ColorConsts.secondaryPink,
foregroundColor: Colors.white,
textStyle: TextStyle(fontSize: 16, fontFamily: "DroidKufi"), textStyle: TextStyle(fontSize: 16, fontFamily: "DroidKufi"),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6.0), borderRadius: BorderRadius.circular(6.0),

@ -524,7 +524,7 @@ class _TangheemDetailScreenState extends State<TangheemDetailScreen> {
), ),
style: TextButton.styleFrom( style: TextButton.styleFrom(
backgroundColor: ColorConsts.gradientOrange, backgroundColor: ColorConsts.gradientOrange,
primary: ColorConsts.primaryBlue, foregroundColor: ColorConsts.primaryBlue,
padding: EdgeInsets.only(top: 4, bottom: 4, right: 8, left: 8), padding: EdgeInsets.only(top: 4, bottom: 4, right: 8, left: 8),
textStyle: TextStyle(color: Colors.white, fontSize: 12), textStyle: TextStyle(color: Colors.white, fontSize: 12),
), ),
@ -843,7 +843,7 @@ class _TangheemDetailScreenState extends State<TangheemDetailScreen> {
borderRadius: BorderRadius.circular(30), borderRadius: BorderRadius.circular(30),
onTap: () async { onTap: () async {
if (!AppState().isUserLogin) { if (!AppState().isUserLogin) {
Widget cancelButton = FlatButton( Widget cancelButton = TextButton(style: TextButton.styleFrom(backgroundColor: ColorConsts.sliderBackground,foregroundColor: ColorConsts.primaryBlack),
child: Text("أرغب بالتسجيل"), child: Text("أرغب بالتسجيل"),
onPressed: () async { onPressed: () async {
Navigator.pop(context); Navigator.pop(context);
@ -853,22 +853,21 @@ class _TangheemDetailScreenState extends State<TangheemDetailScreen> {
} }
}, },
); );
Widget continueButton = FlatButton( Widget continueButton = TextButton(style: TextButton.styleFrom(backgroundColor: ColorConsts.sliderBackground,foregroundColor: ColorConsts.primaryBlack),
child: Text("استمرار كضيف"), child: Text("استمرار كضيف"),
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
return; return;
}, },
); );
AlertDialog alert = AlertDialog( AlertDialog alert = AlertDialog(
content: Text("هذه الخاصية متاحه فقط للأعضاء المسجلين"), content: Text("هذه الخاصية متاحه فقط للأعضاء المسجلين"),
actionsAlignment:MainAxisAlignment.spaceEvenly,
actions: [ actions: [
cancelButton, cancelButton,
continueButton, continueButton,
], ],
); );
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {

Loading…
Cancel
Save