final changes by client done.

development
Sikander Saleem 5 years ago
parent 47de629081
commit f94177e645

@ -158,141 +158,148 @@ 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, physics: BouncingScrollPhysics(),
child: IconButton( padding: EdgeInsets.only(left: 24, right: 24),
icon: Icon(Icons.clear, color: ColorConsts.textGrey), itemCount: navigationList.length,
onPressed: () { itemBuilder: (context, index) {
if (_scaffoldKey.currentState.isDrawerOpen) { String icon = "assets/icons/${navigationList[index].mobileFontIcon}.svg";
Navigator.pop(context); var subList = navigationList.where((element) => element.parentId == navigationList[index].navigationId).toList();
} return Column(
}, mainAxisSize: MainAxisSize.min,
), children: [
), if (navigationList[index].parentId == 1)
Container( myListItem(icon, navigationList[index].navigationText, navigationList[index].orderNo == 1 ? true : false, onTap: () {
margin: EdgeInsets.only(top: 8, bottom: 16), String url = navigationList[index]?.mobileNavigationUrl ?? "";
padding: EdgeInsets.only(left: 16, right: 16), if (url.isEmpty || url.length < 2) {
child: Row( return;
mainAxisAlignment: MainAxisAlignment.spaceEvenly, }
children: [ Navigator.pushNamed(context, url, arguments: null);
commonIconButton("assets/icons/bookmark.svg", () { }),
Navigator.pushNamed(context, BookmarkScreen.routeName); for (var subItem in subList)
}), Container(
commonIconButton("assets/icons/increase_size.svg", () { width: double.infinity,
if (fontSize >= 36) { child: Row(
Utils.showToast("وصل حجم الخط إلى الحد الأقصى للحجم"); children: [
return; Expanded(
} child: myListItem("assets/icons/${subItem.mobileFontIcon}.svg", subItem.navigationText, false, onTap: () {
fontSize += 2; String url = subItem.mobileNavigationUrl ?? "";
prefs.setInt(GlobalConsts.fontZoomSize, fontSize); if (url.isEmpty) {
Utils.showToast("زيادة حجم الخط"); return;
}), }
commonIconButton("assets/icons/reduce_size.svg", () { var contentId;
if (fontSize <= 12) { if (subItem.mobileNavigationUrl == "/introduction") {
Utils.showToast("وصل حجم الخط إلى الحد الأدنى للحجم"); url = ContentInfoScreen.routeName;
return; contentId = 2;
} else if (subItem.mobileNavigationUrl == "/encyclopedia") {
url = ContentInfoScreen.routeName;
contentId = 1;
}
Navigator.pushNamed(context, url, arguments: contentId);
}),
),
Container(
height: 40,
margin: EdgeInsets.only(right: 17, left: 10),
child: VerticalDivider(color: ColorConsts.primaryBlack, thickness: .7, width: 1),
),
],
),
)
],
);
});
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);
} }
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);
}),
],
), ),
), Container(
Expanded( margin: EdgeInsets.only(top: 8, bottom: 16),
child: ListView.builder( padding: EdgeInsets.only(left: 16, right: 16),
physics: BouncingScrollPhysics(), child: Row(
padding: EdgeInsets.only(left: 24, right: 24), mainAxisAlignment: MainAxisAlignment.spaceEvenly,
itemCount: navigationList.length, children: [
itemBuilder: (context, index) { commonIconButton("assets/icons/bookmark.svg", () {
String icon = "assets/icons/${navigationList[index].mobileFontIcon}.svg"; Navigator.pushNamed(context, BookmarkScreen.routeName);
var subList = navigationList.where((element) => element.parentId == navigationList[index].navigationId).toList(); }),
return Column( commonIconButton("assets/icons/increase_size.svg", () {
mainAxisSize: MainAxisSize.min, if (fontSize >= 36) {
children: [ Utils.showToast("وصل حجم الخط إلى الحد الأقصى للحجم");
if (navigationList[index].parentId == 1) return;
myListItem(icon, navigationList[index].navigationText, navigationList[index].orderNo == 1 ? true : false, onTap: () { }
String url = navigationList[index]?.mobileNavigationUrl ?? ""; fontSize += 2;
if (url.isEmpty || url.length < 2) { prefs.setInt(GlobalConsts.fontZoomSize, fontSize);
return; Utils.showToast("زيادة حجم الخط");
} }),
Navigator.pushNamed(context, url, arguments: null); commonIconButton("assets/icons/reduce_size.svg", () {
}), if (fontSize <= 12) {
for (var subItem in subList) Utils.showToast("وصل حجم الخط إلى الحد الأدنى للحجم");
Container( return;
width: double.infinity, }
child: Row( fontSize -= 2;
children: [ prefs.setInt(GlobalConsts.fontZoomSize, fontSize);
Expanded( Utils.showToast("تم تقليل حجم الخط");
child: myListItem("assets/icons/${subItem.mobileFontIcon}.svg", subItem.navigationText, false, onTap: () { }),
String url = subItem.mobileNavigationUrl ?? ""; commonIconButton("assets/icons/user_logged.svg", () {
if (url.isEmpty) { if (AppState().isUserLogin) {
return; Utils.showToast("أنت بالفعل تسجيل الدخول");
} return;
var contentId; }
if (subItem.mobileNavigationUrl == "/introduction") { Navigator.pushNamed(context, LoginScreen.routeName);
url = ContentInfoScreen.routeName; }),
contentId = 2; ],
} else if (subItem.mobileNavigationUrl == "/encyclopedia") { ),
url = ContentInfoScreen.routeName;
contentId = 1;
}
Navigator.pushNamed(context, url, arguments: contentId);
}),
),
Container(
height: 40,
margin: EdgeInsets.only(right: 17, left: 10),
child: VerticalDivider(color: ColorConsts.primaryBlack, thickness: .7, width: 1),
),
],
),
)
],
);
}),
),
Container(
margin: EdgeInsets.only(top: 16, bottom: 12),
padding: EdgeInsets.only(left: 32, right: 32),
child: Row(
children: [
for (QuickLinksData _quickLink in quickLinks)
commonIconButton(_quickLink.exposeFilePath, () {
_launchURL(_quickLink.imageUrl);
}, size: 35, isAsset: false),
],
), ),
), listContents,
Padding( Container(
padding: EdgeInsets.only(left: 32, right: 32, bottom: 8), margin: EdgeInsets.only(top: 16, bottom: 12),
child: Row( padding: EdgeInsets.only(left: 32, right: 32),
crossAxisAlignment: CrossAxisAlignment.center, child: Row(
mainAxisAlignment: MainAxisAlignment.center, children: [
children: [ for (QuickLinksData _quickLink in quickLinks)
Text( commonIconButton(_quickLink.exposeFilePath, () {
"Powered by Cloud Solutions", _launchURL(_quickLink.imageUrl);
maxLines: 1, }, size: 35, isAsset: false),
textAlign: TextAlign.right, ],
style: TextStyle(fontSize: 14, color: Colors.black87), ),
),
SizedBox(width: 8),
SvgPicture.asset("assets/logos/cloud_logo.svg", width: 30, height: 30)
],
), ),
) Padding(
], padding: EdgeInsets.only(left: 32, right: 32, bottom: 8),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"Powered by Cloud Solutions",
maxLines: 1,
textAlign: TextAlign.right,
style: TextStyle(fontSize: 14, color: Colors.black87),
),
SizedBox(width: 8),
SvgPicture.asset("assets/logos/cloud_logo.svg", width: 30, height: 30)
],
),
)
];
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("إعادة تعيين كلمة المرور"),
), ),
), ),
], ],

@ -86,7 +86,7 @@ class _HomeScreenState extends State<HomeScreen> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ 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), SizedBox(height: 4),

@ -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,148 +197,179 @@ 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), Text(
width: double.infinity, "اقرأ القرآن الكريم",
child: Column( style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: ColorConsts.primaryBlue, height: 1),
crossAxisAlignment: CrossAxisAlignment.start, ),
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),
Row(
children: [ children: [
Text( Expanded(
"اقرأ القرآن الكريم", child: CommonDropDownButton(_selectedSurah, hintText: "اختر السورة", list: _surahList, onSelect: (index) {
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: ColorConsts.primaryBlue, height: 1), if (_selectedSurah != index) {
_selectedSurah = index;
_selectedToAya = -1;
_selectedFromAya = -1;
_toAyaList = [];
filterData();
}
}),
),
SizedBox(width: 4),
Expanded(
child: CommonDropDownButton(_selectedFromAya, hintText: "من الآية", list: _fromAyaList.map((e) => "من الآية" + " $e").toList(), onSelect: (index) {
if (_selectedFromAya != index) {
_selectedFromAya = index;
filteredAyahList.indexOf(_selectedFromAya);
_toAyaList = filteredAyahList.getRange(_selectedFromAya + 1, filteredAyahList.length)?.toList() ?? [];
setState(() {});
}
}),
),
SizedBox(width: 4),
Expanded(
child: CommonDropDownButton(_selectedToAya, hintText: "إلى الآية", list: _toAyaList.map((e) => "إلى الآية" + " $e").toList(), onSelect: (index) {
if (_selectedToAya != index) {
_selectedToAya = index;
setState(() {});
}
}),
), ),
SizedBox(height: 16), ],
),
SizedBox(height: 8),
Row(
children: [
commonIconButton("عرض", "assets/icons/go_forward.svg", () {
if (_selectedSurah < 0) {
Utils.showToast("يرجى اختيار السورة");
return;
} else {
if (_selectedFromAya < 0 && _selectedToAya < 0) {
_currentPage = _surahModel?.data[_selectedSurah]?.startPageNo;
getQuranByPageNo();
return;
}
if (_selectedFromAya >= 0 && _selectedToAya >= 0) {
getAyaByRange();
return;
}
}
}),
],
),
SizedBox(height: 16),
];
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),
padding: EdgeInsets.only(top: 16, bottom: 4, right: 16, left: 16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( nextOptionButton(
child: CommonDropDownButton(_selectedSurah, hintText: "اختر السورة", list: _surahList, onSelect: (index) { "assets/icons/prev.svg",
if (_selectedSurah != index) { _currentSurahIndex <= 0 ? "" : Utils.getNotNullValue(_surahList, _currentSurahIndex - 1) ?? "",
_selectedSurah = index; _currentSurahIndex <= 0
_selectedToAya = -1; ? null
_selectedFromAya = -1; : (value) {
_toAyaList = []; _currentPage = _surahModel?.data?.elementAt(_surahList.indexOf(value))?.startPageNo ?? _currentPage;
filterData(); _clearFilterAndRefreshData();
} }),
}), previousOptionButton(
), "assets/icons/next.svg",
SizedBox(width: 4), _currentSurahIndex >= (_surahList.isNotEmpty ? (_surahList.length - 1) : 0) ? "" : Utils.getNotNullValue(_surahList, _currentSurahIndex + 1) ?? "",
Expanded( _currentSurahIndex >= (_surahList.isNotEmpty ? (_surahList.length - 1) : 0)
child: CommonDropDownButton(_selectedFromAya, hintText: "من الآية", list: _fromAyaList.map((e) => "من الآية" + " $e").toList(), onSelect: (index) { ? null
if (_selectedFromAya != index) { : (value) {
_selectedFromAya = index; _currentPage = _surahModel?.data?.singleWhere((element) => element.nameAR == value)?.startPageNo ?? _currentPage;
filteredAyahList.indexOf(_selectedFromAya); _clearFilterAndRefreshData();
_toAyaList = filteredAyahList.getRange(_selectedFromAya + 1, filteredAyahList.length)?.toList() ?? []; }),
setState(() {});
}
}),
),
SizedBox(width: 4),
Expanded(
child: CommonDropDownButton(_selectedToAya, hintText: "إلى الآية", list: _toAyaList.map((e) => "إلى الآية" + " $e").toList(), onSelect: (index) {
if (_selectedToAya != index) {
_selectedToAya = index;
setState(() {});
}
}),
),
], ],
), ),
SizedBox(height: 8), quranTextView,
SizedBox(height: 4),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
commonIconButton("عرض", "assets/icons/go_forward.svg", () { nextOptionButton(
if (_selectedSurah < 0) { "assets/icons/prev_single.svg",
Utils.showToast("يرجى اختيار السورة"); "الصفحة السابقة",
return; _currentPage <= 1
} else { ? null
if (_selectedFromAya < 0 && _selectedToAya < 0) { : (value) {
_currentPage = _surahModel?.data[_selectedSurah]?.startPageNo; _currentPage = _currentPage - 1;
getQuranByPageNo(); _clearFilterAndRefreshData();
return; }),
} previousOptionButton(
if (_selectedFromAya >= 0 && _selectedToAya >= 0) { "assets/icons/next_single.svg",
getAyaByRange(); "الصفحة التالية",
return; _currentPage == 604
} ? null
} : (value) {
}), _currentPage = _currentPage + 1;
_clearFilterAndRefreshData();
}),
], ],
), ),
SizedBox(height: 16),
if (_surahAya.isNotEmpty)
Expanded(
child: Container(
margin: EdgeInsets.only(top: 4, bottom: 4),
padding: EdgeInsets.only(top: 16, bottom: 4, right: 16, left: 16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
nextOptionButton(
"assets/icons/prev.svg",
_currentSurahIndex <= 0 ? "" : Utils.getNotNullValue(_surahList, _currentSurahIndex - 1) ?? "",
_currentSurahIndex <= 0
? null
: (value) {
_currentPage = _surahModel?.data?.elementAt(_surahList.indexOf(value))?.startPageNo ?? _currentPage;
_clearFilterAndRefreshData();
}),
previousOptionButton(
"assets/icons/next.svg",
_currentSurahIndex >= (_surahList.isNotEmpty ? (_surahList.length - 1) : 0) ? "" : Utils.getNotNullValue(_surahList, _currentSurahIndex + 1) ?? "",
_currentSurahIndex >= (_surahList.isNotEmpty ? (_surahList.length - 1) : 0)
? null
: (value) {
_currentPage = _surahModel?.data?.singleWhere((element) => element.nameAR == value)?.startPageNo ?? _currentPage;
_clearFilterAndRefreshData();
}),
],
),
Expanded(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Padding(
padding: EdgeInsets.only(left: 4, right: 4),
child: quranText(),
),
),
),
SizedBox(height: 4),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
nextOptionButton(
"assets/icons/prev_single.svg",
"الصفحة السابقة",
_currentPage <= 1
? null
: (value) {
_currentPage = _currentPage - 1;
_clearFilterAndRefreshData();
}),
previousOptionButton(
"assets/icons/next_single.svg",
"الصفحة التالية",
_currentPage == 604
? null
: (value) {
_currentPage = _currentPage + 1;
_clearFilterAndRefreshData();
}),
],
),
],
),
),
),
], ],
), ),
); );
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,28 +124,28 @@ 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: [ children: [
Text(
_ayatTangheemTypeMappedFirstData.tangheemTypeName ?? "",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: ColorConsts.primaryBlue, height: 1.5),
),
SizedBox(height: 8),
Text(
_ayatTangheemTypeMappedFirstData.tangheemTypeDescription ?? "",
style: TextStyle(fontSize: 14, color: ColorConsts.textGrey, height: 1),
),
SizedBox(height: 8),
Expanded( Expanded(
child: ListView( child: ListView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(bottom: 16), padding: EdgeInsets.only(bottom: 16, top: 16),
children: [ children: [
Text(
_ayatTangheemTypeMappedFirstData.tangheemTypeName ?? "",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: ColorConsts.primaryBlue, height: 1.5),
),
SizedBox(height: 8),
Text(
_ayatTangheemTypeMappedFirstData.tangheemTypeDescription ?? "",
style: TextStyle(fontSize: 14, color: ColorConsts.textGrey, height: 1),
),
SizedBox(height: 8),
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