final changes by client done.

development
Sikander Saleem 5 years ago
parent 47de629081
commit f94177e645

@ -158,60 +158,11 @@ class _CommonAppbarState extends State<CommonAppbar> {
right: false, right: false,
left: false, left: false,
maintainBottomViewPadding: true, maintainBottomViewPadding: true,
child: Column( child: Builder(
children: [ builder: (context) {
Container( bool isPortrait = MediaQuery.of(context).orientation == Orientation.portrait;
height: 100 + height, Widget listContents = ListView.builder(
padding: EdgeInsets.only(left: 0, top: height), shrinkWrap: true,
alignment: Alignment.centerLeft,
child: IconButton(
icon: Icon(Icons.clear, color: ColorConsts.textGrey),
onPressed: () {
if (_scaffoldKey.currentState.isDrawerOpen) {
Navigator.pop(context);
}
},
),
),
Container(
margin: EdgeInsets.only(top: 8, bottom: 16),
padding: EdgeInsets.only(left: 16, right: 16),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
commonIconButton("assets/icons/bookmark.svg", () {
Navigator.pushNamed(context, BookmarkScreen.routeName);
}),
commonIconButton("assets/icons/increase_size.svg", () {
if (fontSize >= 36) {
Utils.showToast("وصل حجم الخط إلى الحد الأقصى للحجم");
return;
}
fontSize += 2;
prefs.setInt(GlobalConsts.fontZoomSize, fontSize);
Utils.showToast("زيادة حجم الخط");
}),
commonIconButton("assets/icons/reduce_size.svg", () {
if (fontSize <= 12) {
Utils.showToast("وصل حجم الخط إلى الحد الأدنى للحجم");
return;
}
fontSize -= 2;
prefs.setInt(GlobalConsts.fontZoomSize, fontSize);
Utils.showToast("تم تقليل حجم الخط");
}),
commonIconButton("assets/icons/user_logged.svg", () {
if (AppState().isUserLogin) {
Utils.showToast("أنت بالفعل تسجيل الدخول");
return;
}
Navigator.pushNamed(context, LoginScreen.routeName);
}),
],
),
),
Expanded(
child: ListView.builder(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(left: 24, right: 24), padding: EdgeInsets.only(left: 24, right: 24),
itemCount: navigationList.length, itemCount: navigationList.length,
@ -261,8 +212,62 @@ class _CommonAppbarState extends State<CommonAppbar> {
) )
], ],
); );
});
if (isPortrait) {
listContents = Expanded(child: listContents);
}
List<Widget> list = [
Container(
height: 100 + height,
padding: EdgeInsets.only(left: 0, top: height),
alignment: Alignment.centerLeft,
child: IconButton(
icon: Icon(Icons.clear, color: ColorConsts.textGrey),
onPressed: () {
if (_scaffoldKey.currentState.isDrawerOpen) {
Navigator.pop(context);
}
},
),
),
Container(
margin: EdgeInsets.only(top: 8, bottom: 16),
padding: EdgeInsets.only(left: 16, right: 16),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
commonIconButton("assets/icons/bookmark.svg", () {
Navigator.pushNamed(context, BookmarkScreen.routeName);
}),
commonIconButton("assets/icons/increase_size.svg", () {
if (fontSize >= 36) {
Utils.showToast("وصل حجم الخط إلى الحد الأقصى للحجم");
return;
}
fontSize += 2;
prefs.setInt(GlobalConsts.fontZoomSize, fontSize);
Utils.showToast("زيادة حجم الخط");
}),
commonIconButton("assets/icons/reduce_size.svg", () {
if (fontSize <= 12) {
Utils.showToast("وصل حجم الخط إلى الحد الأدنى للحجم");
return;
}
fontSize -= 2;
prefs.setInt(GlobalConsts.fontZoomSize, fontSize);
Utils.showToast("تم تقليل حجم الخط");
}), }),
commonIconButton("assets/icons/user_logged.svg", () {
if (AppState().isUserLogin) {
Utils.showToast("أنت بالفعل تسجيل الدخول");
return;
}
Navigator.pushNamed(context, LoginScreen.routeName);
}),
],
), ),
),
listContents,
Container( Container(
margin: EdgeInsets.only(top: 16, bottom: 12), margin: EdgeInsets.only(top: 16, bottom: 12),
padding: EdgeInsets.only(left: 32, right: 32), padding: EdgeInsets.only(left: 32, right: 32),
@ -292,7 +297,9 @@ class _CommonAppbarState extends State<CommonAppbar> {
], ],
), ),
) )
], ];
return isPortrait ? Column(children: list) : ListView(children: list);
},
), ),
), ),
), ),

@ -57,9 +57,9 @@ class _ChangePasswordDialogState extends State<ChangePasswordDialog> {
style: TextStyle(color: Colors.white, fontSize: 22), style: TextStyle(color: Colors.white, fontSize: 22),
), ),
SizedBox(height: 16), SizedBox(height: 16),
CommonTextFieldWidget(hint: "الايميل المسجل", controller: _passwordController, prefixIcon: "assets/icons/password.svg"), CommonTextFieldWidget(hint: "كلمة المرور الجديدة", controller: _passwordController, prefixIcon: "assets/icons/password.svg"),
SizedBox(height: 8), SizedBox(height: 8),
CommonTextFieldWidget(hint: "تأكيد كلمة المرور", controller: _confirmPasswordController, prefixIcon: "assets/icons/password.svg"), CommonTextFieldWidget(hint: "تأكيد كلمة المرور الجديدة", controller: _confirmPasswordController, prefixIcon: "assets/icons/password.svg"),
SizedBox(height: 16), SizedBox(height: 16),
SizedBox( SizedBox(
width: double.infinity, width: double.infinity,
@ -67,15 +67,15 @@ class _ChangePasswordDialogState extends State<ChangePasswordDialog> {
child: TextButton( child: TextButton(
onPressed: () { onPressed: () {
if (_passwordController.text.length < 1) { if (_passwordController.text.length < 1) {
Utils.showToast("كلمة المرور فارغة"); Utils.showToast("يرجى إاخال كلمة المرور");
return; return;
} }
if (_confirmPasswordController.text.length < 1) { if (_confirmPasswordController.text.length < 1) {
Utils.showToast("تأكيد كلمة المرور فارغ"); Utils.showToast("يرجى تأكيد كلمة المرور");
return; return;
} }
if (_passwordController.text != _confirmPasswordController.text) { if (_passwordController.text != _confirmPasswordController.text) {
Utils.showToast("كلمة المرور خاطئة"); Utils.showToast("خطأ في تطابق كلمات المرور");
return; return;
} }
widget.onPassword(_passwordController.text); widget.onPassword(_passwordController.text);
@ -89,7 +89,7 @@ class _ChangePasswordDialogState extends State<ChangePasswordDialog> {
borderRadius: BorderRadius.circular(6.0), borderRadius: BorderRadius.circular(6.0),
), ),
), ),
child: Text("تحديث"), child: Text("إعادة تعيين كلمة المرور"),
), ),
), ),
], ],

@ -53,7 +53,7 @@ class _OTPDialogState extends State<OTPDialog> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text( Text(
"الرجاء ادخال الرقم المرسل إلى جوالك", "الرجاء إدخال الرقم المرسل إلى جوالك",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
@ -91,7 +91,7 @@ class _OTPDialogState extends State<OTPDialog> {
child: TextButton( child: TextButton(
onPressed: () { onPressed: () {
if (otpMessage.length < 4) { if (otpMessage.length < 4) {
Utils.showToast("OTP غير صحيح"); Utils.showToast("الرقم الذي قمت بإدخاله غير صحيح");
return; return;
} }
widget.onOTP(int.parse(otpMessage)); widget.onOTP(int.parse(otpMessage));

@ -76,7 +76,7 @@ class _BookmarkScreenState extends State<BookmarkScreen> {
onTap: () { onTap: () {
_bookMarkList.removeAt(index); _bookMarkList.removeAt(index);
BookMarkModel.saveToPrefs(_bookMarkList); BookMarkModel.saveToPrefs(_bookMarkList);
Utils.showToast("تمت إزالة الإشارة المرجعية"); Utils.showToast("تم حذف المرجع");
setState(() {}); setState(() {});
}, },
), ),

@ -33,7 +33,7 @@ class _ContactUsScreenState extends State<ContactUsScreen> {
Utils.showLoading(context); Utils.showLoading(context);
try { try {
await TangheemUserApiClient().contactUs(_firstName, _lastName, _email, _phone, _description); await TangheemUserApiClient().contactUs(_firstName, _lastName, _email, _phone, _description);
Utils.showToast("شكرا لك على مراسلتنا ، نحن نقدر كلماتك."); Utils.showToast("تم إرسال الطلب بنجاح");
Utils.hideLoading(context); Utils.hideLoading(context);
Navigator.pop(context); Navigator.pop(context);
} catch (ex) { } catch (ex) {
@ -91,15 +91,15 @@ class _ContactUsScreenState extends State<ContactUsScreen> {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
CommonTextFieldWidget(hint: "الاسم الاول", controller: _firstNameController), CommonTextFieldWidget(hint: "الاسم الأول", controller: _firstNameController),
SizedBox(height: 8), SizedBox(height: 8),
CommonTextFieldWidget(hint: "اسم النهاية", controller: _lastNameController), CommonTextFieldWidget(hint: "الاسم الأخير", controller: _lastNameController),
SizedBox(height: 8), SizedBox(height: 8),
CommonTextFieldWidget(hint: "الايميل", controller: _emailController), CommonTextFieldWidget(hint: "البريد الإلكتروني", controller: _emailController),
SizedBox(height: 8), SizedBox(height: 8),
CommonTextFieldWidget(hint: " رقم الجوال${" (" + ("9xx") + " xxxxxxxxx)"}", controller: _mobileNumberController), CommonTextFieldWidget(hint: " رقم الاتصال${" (" + ("9xx") + " xxxxxxxxx)"}", controller: _mobileNumberController),
SizedBox(height: 8), SizedBox(height: 8),
CommonTextFieldWidget(hint: "اكتب لنا", controller: _descriptionController, maxLines: 4), CommonTextFieldWidget(hint: "التفاصيل", controller: _descriptionController, maxLines: 4),
SizedBox(height: 12), SizedBox(height: 12),
SizedBox( SizedBox(
width: double.infinity, width: double.infinity,
@ -107,27 +107,35 @@ class _ContactUsScreenState extends State<ContactUsScreen> {
child: TextButton( child: TextButton(
onPressed: () { onPressed: () {
if (_firstNameController.text.length < 1) { if (_firstNameController.text.length < 1) {
Utils.showToast("الاسم الأول فارغ"); Utils.showToast("يرجى إدخال الاسم الأول");
return; return;
} }
if (_lastNameController.text.length < 1) { if (_lastNameController.text.length < 1) {
Utils.showToast("الاسم الأخير فارغ"); Utils.showToast("يرجى إدخال الاسم الأخير");
return; return;
} }
if (_emailController.text.length < 1) { if (_emailController.text.length < 1) {
Utils.showToast("البريد الإلكتروني فارغ"); Utils.showToast("يرجى إدخال البريد الإلكتروني");
return; return;
} }
if (_mobileNumberController.text.length < 1) { if (_mobileNumberController.text.length < 1) {
Utils.showToast("رقم الهاتف فارغ"); Utils.showToast("يرجى إدخال رقم الهاتف");
return;
}
if (_mobileNumberController.text.length != 12) {
Utils.showToast("صيغة الرقم غير صحيحة");
return; return;
} }
if (_descriptionController.text.length < 1) { if (_descriptionController.text.length < 1) {
Utils.showToast("يجب أن تكتب لنا كلمات قليلة"); Utils.showToast("يرجى إدخال التفاصيل");
return;
}
if (_descriptionController.text.trim().length < 1) {
Utils.showToast("يرجى إدخال التفاصيل");
return; return;
} }
if (!_emailController.text.isValidEmail()) { if (!_emailController.text.isValidEmail()) {
Utils.showToast("بريد إلكتروني خاطئ"); Utils.showToast("صيغة البريد الإلكتروني غير صحيحة");
return; return;
} }
sendFeedback(_firstNameController.text, _lastNameController.text, _emailController.text, _mobileNumberController.text, _descriptionController.text); sendFeedback(_firstNameController.text, _lastNameController.text, _emailController.text, _mobileNumberController.text, _descriptionController.text);
@ -140,7 +148,7 @@ class _ContactUsScreenState extends State<ContactUsScreen> {
borderRadius: BorderRadius.circular(6.0), borderRadius: BorderRadius.circular(6.0),
), ),
), ),
child: Text("ارسل رأيك"), child: Text("إرسال"),
), ),
), ),
], ],

@ -74,7 +74,7 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> {
Utils.hideLoading(context); Utils.hideLoading(context);
} }
Navigator.pop(context); Navigator.pop(context);
Utils.showToast("تم تغيير الرقم السري بنجاح"); Utils.showToast("تم تغيير كلمة المرور بنجاح");
Navigator.pop(context); Navigator.pop(context);
} }
@ -115,7 +115,7 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
SizedBox(height: 8), SizedBox(height: 8),
CommonTextFieldWidget(hint: "الايميل المسجل", controller: _emailController, prefixIcon: "assets/icons/email.svg"), CommonTextFieldWidget(hint: "البريد الإلكتروني المسجل", controller: _emailController, prefixIcon: "assets/icons/email.svg"),
SizedBox(height: 12), SizedBox(height: 12),
SizedBox( SizedBox(
width: double.infinity, width: double.infinity,
@ -123,10 +123,10 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> {
child: TextButton( child: TextButton(
onPressed: () { onPressed: () {
if (_emailController.text.length < 1) { if (_emailController.text.length < 1) {
Utils.showToast("البريد الإلكتروني فارغ"); Utils.showToast("يرجى إدخال البريد الإلكتروني");
return; return;
} else if (!_emailController.text.isValidEmail()) { } else if (!_emailController.text.isValidEmail()) {
Utils.showToast("بريد إلكتروني خاطئ"); Utils.showToast("صيغة البريد الإلكتروني خاطئة");
return; return;
} }
forgotPassword(_emailController.text); forgotPassword(_emailController.text);
@ -139,7 +139,7 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> {
borderRadius: BorderRadius.circular(6.0), borderRadius: BorderRadius.circular(6.0),
), ),
), ),
child: Text("اعادة تعيين كلمة المرور"), child: Text("إعادة تعيين كلمة المرور"),
), ),
), ),
], ],

@ -108,7 +108,7 @@ class _LoginScreenState extends State<LoginScreen> {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
CommonTextFieldWidget(hint: "الايميل المسجل", controller: _emailController, prefixIcon: "assets/icons/email.svg"), CommonTextFieldWidget(hint: "البريد الإلكتروني", controller: _emailController, prefixIcon: "assets/icons/email.svg"),
SizedBox(height: 16), SizedBox(height: 16),
CommonTextFieldWidget(hint: "كلمة المرور", controller: _passwordController, isPassword: true, prefixIcon: "assets/icons/password.svg"), CommonTextFieldWidget(hint: "كلمة المرور", controller: _passwordController, isPassword: true, prefixIcon: "assets/icons/password.svg"),
SizedBox(height: 16), SizedBox(height: 16),
@ -118,14 +118,14 @@ class _LoginScreenState extends State<LoginScreen> {
child: TextButton( child: TextButton(
onPressed: () { onPressed: () {
if (_emailController.text.length < 1) { if (_emailController.text.length < 1) {
Utils.showToast("البريد الإلكتروني فارغ"); Utils.showToast("يرجى إدخال البريد الإلكتروني");
return; return;
} else if (!_emailController.text.isValidEmail()) { } else if (!_emailController.text.isValidEmail()) {
Utils.showToast("بريد إلكتروني خاطئ"); Utils.showToast("صيغة البريد الإلكتروني خاطئة");
return; return;
} }
if (_passwordController.text.length < 1) { if (_passwordController.text.length < 1) {
Utils.showToast("كلمة المرور فارغة"); Utils.showToast("يرجى إدخال كلمة المرور");
return; return;
} }
performLogin(_emailController.text, _passwordController.text); performLogin(_emailController.text, _passwordController.text);
@ -195,7 +195,7 @@ class _LoginScreenState extends State<LoginScreen> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text( Text(
"انشاء حساب جديد", " حساب جديد",
style: TextStyle(fontSize: 14, color: Colors.white), style: TextStyle(fontSize: 14, color: Colors.white),
), ),
Icon(Icons.arrow_forward_ios, color: Colors.white, size: 12), Icon(Icons.arrow_forward_ios, color: Colors.white, size: 12),

@ -197,16 +197,24 @@ class _QuranScreenState extends State<QuranScreen> {
_surahAya = _surahAya + "\n" + "$_currentPage"; _surahAya = _surahAya + "\n" + "$_currentPage";
return Container( List<Widget> widList = [
padding: EdgeInsets.fromLTRB(16, 24, 16, 0),
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text( Text(
"اقرأ القرآن الكريم", "اقرأ القرآن الكريم",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: ColorConsts.primaryBlue, height: 1), style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: ColorConsts.primaryBlue, height: 1),
), ),
SizedBox(height: 4),
Text(
"قراءة وسماع آيات القرآن الكريم",
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 16, color: ColorConsts.primaryBlue),
),
SizedBox(height: 4),
Text(
"اضغط الآية المرغوبة لمزيد من التفاصيل",
style: TextStyle(
fontSize: 12,
color: ColorConsts.primaryBlue,
),
),
SizedBox(height: 16), SizedBox(height: 16),
Row( Row(
children: [ children: [
@ -265,9 +273,20 @@ class _QuranScreenState extends State<QuranScreen> {
], ],
), ),
SizedBox(height: 16), SizedBox(height: 16),
if (_surahAya.isNotEmpty) ];
Expanded(
child: Container( Widget quranTextView = SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Padding(
padding: EdgeInsets.only(left: 4, right: 4),
child: quranText(),
),
);
if (MediaQuery.of(context).orientation == Orientation.portrait) {
quranTextView = Expanded(child: quranTextView);
}
Widget quranView = Container(
margin: EdgeInsets.only(top: 4, bottom: 4), margin: EdgeInsets.only(top: 4, bottom: 4),
padding: EdgeInsets.only(top: 16, bottom: 4, right: 16, left: 16), padding: EdgeInsets.only(top: 16, bottom: 4, right: 16, left: 16),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -275,6 +294,7 @@ class _QuranScreenState extends State<QuranScreen> {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -299,15 +319,7 @@ class _QuranScreenState extends State<QuranScreen> {
}), }),
], ],
), ),
Expanded( quranTextView,
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Padding(
padding: EdgeInsets.only(left: 4, right: 4),
child: quranText(),
),
),
),
SizedBox(height: 4), SizedBox(height: 4),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -334,11 +346,30 @@ class _QuranScreenState extends State<QuranScreen> {
), ),
], ],
), ),
);
if (MediaQuery.of(context).orientation == Orientation.portrait) {
quranView = Expanded(child: quranView);
}
List<Widget> finalViewList = <Widget>[] + widList + [if (_surahAya.isNotEmpty) quranView];
var multiModeView;
if (MediaQuery.of(context).orientation == Orientation.portrait) {
multiModeView = Padding(
padding: EdgeInsets.fromLTRB(16, 24, 16, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: finalViewList,
), ),
),
],
),
); );
} else {
multiModeView = ListView(
padding: EdgeInsets.fromLTRB(16, 24, 16, 0),
physics: BouncingScrollPhysics(),
children: finalViewList,
);
}
return SizedBox(width: double.infinity, child: multiModeView);
} }
Widget commonIconButton(String title, String iconString, VoidCallback callback) { Widget commonIconButton(String title, String iconString, VoidCallback callback) {

@ -6,6 +6,7 @@ import 'package:tangheem/classes/colors.dart';
import 'package:tangheem/classes/utils.dart'; import 'package:tangheem/classes/utils.dart';
import 'package:tangheem/extensions/string_extensions.dart'; import 'package:tangheem/extensions/string_extensions.dart';
import 'package:tangheem/models/country_model.dart'; import 'package:tangheem/models/country_model.dart';
import 'package:tangheem/models/general_response_model.dart';
import 'package:tangheem/ui/bottom_sheets/country_selection_bottom_sheet.dart'; import 'package:tangheem/ui/bottom_sheets/country_selection_bottom_sheet.dart';
import 'package:tangheem/widgets/common_textfield_widget.dart'; import 'package:tangheem/widgets/common_textfield_widget.dart';
@ -57,8 +58,13 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
void registerUser(String _firstName, String _lastName, String _email, String _password, String _countryCode, String _phone) async { void registerUser(String _firstName, String _lastName, String _email, String _password, String _countryCode, String _phone) async {
Utils.showLoading(context); Utils.showLoading(context);
try { try {
await UserApiClient().registerUser(_firstName, _lastName, _email, _password, _countryCode, _phone); GeneralResponseModel model = await UserApiClient().registerUser(_firstName, _lastName, _email, _password, _countryCode, _phone);
Utils.showToast("تسجيل بنجاح"); if(model.message == "UserRegistration Already Exists") {
Utils.showToast("البريد الإلكتروني مستخدم سابقا");
Utils.hideLoading(context);
return;
}
Utils.showToast("تم إنشاء الحساب بنجاح");
Utils.hideLoading(context); Utils.hideLoading(context);
Navigator.pop(context); Navigator.pop(context);
} catch (ex) { } catch (ex) {
@ -116,14 +122,14 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
CommonTextFieldWidget(hint: "الاسم الاول", controller: _firstNameController), CommonTextFieldWidget(hint: "البريد الإلكتروني", controller: _emailController),
SizedBox(height: 8), SizedBox(height: 8),
CommonTextFieldWidget(hint: "اسم النهاية", controller: _lastNameController), CommonTextFieldWidget(hint: "الاسم الأول", controller: _firstNameController),
SizedBox(height: 8), SizedBox(height: 8),
CommonTextFieldWidget(hint: "الايميل", controller: _emailController), CommonTextFieldWidget(hint: "الاسم الأخير", controller: _lastNameController),
SizedBox(height: 8), SizedBox(height: 8),
CommonTextFieldWidget( CommonTextFieldWidget(
hint: _selectedCountry?.countryNameAr ?? "البلد", hint: _selectedCountry?.countryNameAr ?? "الدولة",
controller: null, controller: null,
suffixWidget: Icon(Icons.keyboard_arrow_down, size: 18, color: ColorConsts.secondaryOrange), suffixWidget: Icon(Icons.keyboard_arrow_down, size: 18, color: ColorConsts.secondaryOrange),
onTap: () { onTap: () {
@ -169,46 +175,46 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
child: TextButton( child: TextButton(
onPressed: () { onPressed: () {
if (_firstNameController.text.length < 1) { if (_firstNameController.text.length < 1) {
Utils.showToast("اسم المستخدم فارغ"); Utils.showToast("يرجى إدخال الاسم الأول");
return; return;
} }
if (_lastNameController.text.length < 1) { if (_lastNameController.text.length < 1) {
Utils.showToast("الاسم فارغ"); Utils.showToast("يرجى إدخال الاسم الأخير");
return; return;
} }
if (_emailController.text.length < 1) { if (_emailController.text.length < 1) {
Utils.showToast("البريد الإلكتروني فارغ"); Utils.showToast("يرجى إدخال البريد الإلكتروني");
return; return;
} }
if (_selectedCountry?.countryCode == null) { if (_selectedCountry?.countryCode == null) {
Utils.showToast("يجب عليك اختيار الدولة"); Utils.showToast("يرجى اختيار الدولة");
return; return;
} }
if (_mobileNumberController.text.length < 1) { if (_mobileNumberController.text.length < 1) {
Utils.showToast("رقم الهاتف فارغ"); Utils.showToast("يرجى إدخال رقم الجوال");
return; return;
} }
if (_passwordController.text.length < 1) { if (_passwordController.text.length < 1) {
Utils.showToast("كلمة المرور فارغة"); Utils.showToast("يرجى إدخال كلمة المرور");
return; return;
} }
if (_confirmPasswordController.text.length < 1) { if (_confirmPasswordController.text.length < 1) {
Utils.showToast("أدخل كلمة المرور نفسها للتأكيد"); Utils.showToast("يرجى تأكيد كلمة المرور");
return; return;
} }
if (!_emailController.text.isValidEmail()) { if (!_emailController.text.isValidEmail()) {
Utils.showToast("بريد إلكتروني خاطئ"); Utils.showToast("صيغة البريد الإلكتروني خاطئة");
return; return;
} }
if (_passwordController.text != _confirmPasswordController.text) { if (_passwordController.text != _confirmPasswordController.text) {
Utils.showToast("كلمات السر الخاصة بك غير صحيحة"); Utils.showToast("كلمة المرور غير متطابقة");
return; return;
} }
if (!_isAccept) { if (!_isAccept) {
Utils.showToast("يجب عليك قبول البيان للمتابعة"); Utils.showToast("الرجاء الموافقة على سياسة الخصوصية");
return; return;
} }
registerUser( registerUser(

@ -47,6 +47,8 @@ class _TangheemDetailScreenState extends State<TangheemDetailScreen> {
AyatTangheemTypeMappedData _ayatTangheemTypeMappedFirstData; AyatTangheemTypeMappedData _ayatTangheemTypeMappedFirstData;
DiscussionModel _discussionModel; DiscussionModel _discussionModel;
bool showAyaPlayer = false;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -122,12 +124,17 @@ class _TangheemDetailScreenState extends State<TangheemDetailScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: EdgeInsets.fromLTRB(16, 24, 16, 0), padding: EdgeInsets.fromLTRB(16, 0, 16, 0),
width: double.infinity, width: double.infinity,
child: _ayatTangheemTypeMappedFirstData == null child: _ayatTangheemTypeMappedFirstData == null
? SizedBox() ? SizedBox()
: Column( : Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: ListView(
physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(bottom: 16, top: 16),
children: [ children: [
Text( Text(
_ayatTangheemTypeMappedFirstData.tangheemTypeName ?? "", _ayatTangheemTypeMappedFirstData.tangheemTypeName ?? "",
@ -139,11 +146,6 @@ class _TangheemDetailScreenState extends State<TangheemDetailScreen> {
style: TextStyle(fontSize: 14, color: ColorConsts.textGrey, height: 1), style: TextStyle(fontSize: 14, color: ColorConsts.textGrey, height: 1),
), ),
SizedBox(height: 8), SizedBox(height: 8),
Expanded(
child: ListView(
physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(bottom: 16),
children: [
Container( Container(
margin: EdgeInsets.only(top: 4, bottom: 4), margin: EdgeInsets.only(top: 4, bottom: 4),
padding: EdgeInsets.only(top: 8, bottom: 8, right: 4, left: 4), padding: EdgeInsets.only(top: 8, bottom: 8, right: 4, left: 4),
@ -211,7 +213,7 @@ class _TangheemDetailScreenState extends State<TangheemDetailScreen> {
Row( Row(
children: [ children: [
Text( Text(
" جمله ${_ayatTangheemTypeMappedData.tangheemTypeName} $_tempTangheemIndexWord", " جملة ${_ayatTangheemTypeMappedData.tangheemTypeName} $_tempTangheemIndexWord",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.white, backgroundColor: ColorConsts.primaryBlue), style: TextStyle(fontWeight: FontWeight.bold, color: Colors.white, backgroundColor: ColorConsts.primaryBlue),
), ),
Expanded( Expanded(
@ -311,7 +313,38 @@ class _TangheemDetailScreenState extends State<TangheemDetailScreen> {
], ],
), ),
), ),
AyaPlayerWidget(surahName: _ayatTangheemTypeMappedFirstData?.surahNameAr ?? "", globalKey: _globalKey, voiceNoteList: voiceNoteList) if (MediaQuery.of(context).orientation == Orientation.portrait)
AyaPlayerWidget(surahName: _ayatTangheemTypeMappedFirstData?.surahNameAr ?? "", globalKey: _globalKey, voiceNoteList: voiceNoteList),
if (MediaQuery.of(context).orientation == Orientation.landscape)
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 24,
margin: EdgeInsets.only(bottom: 8,top: 8),
// color: Colors.transparent,
child: TextButton(
onPressed: () {
setState(() {
showAyaPlayer = !showAyaPlayer;
});
},
child: Text(
showAyaPlayer ? "إخفاء التسجيلات" : "إظهار التسجيلات",
style: TextStyle(color: Colors.black87, fontSize: 12),
),
style: TextButton.styleFrom(
backgroundColor: ColorConsts.gradientOrange,
primary: ColorConsts.primaryBlue,
padding: EdgeInsets.only(top: 4, bottom: 4, right: 8, left: 8),
textStyle: TextStyle(color: Colors.white, fontSize: 12),
),
),
),
if (showAyaPlayer) AyaPlayerWidget(surahName: _ayatTangheemTypeMappedFirstData?.surahNameAr ?? "", globalKey: _globalKey, voiceNoteList: voiceNoteList),
],
)
], ],
), ),
); );
@ -651,7 +684,7 @@ class _TangheemDetailScreenState extends State<TangheemDetailScreen> {
), ),
), ),
child: Text( child: Text(
"أضافة تعليق", "إضافة تعليق",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14, color: Colors.white, height: 1.5), style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14, color: Colors.white, height: 1.5),
), ),
), ),

@ -103,9 +103,11 @@ class _AyaPlayerWidgetState extends State<AyaPlayerWidget> {
), ),
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min,
children: [ children: [
Row( Row(
children: [ children: [
if(widget.voiceNoteList.length>1)
PopupMenuButton( PopupMenuButton(
padding: EdgeInsets.fromLTRB(4, 4, 0, 4), padding: EdgeInsets.fromLTRB(4, 4, 0, 4),
onSelected: (int index) { onSelected: (int index) {

Loading…
Cancel
Save