|
|
|
|
@ -31,7 +31,6 @@ class QuranScreen extends StatefulWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _QuranScreenState extends State<QuranScreen> {
|
|
|
|
|
GlobalKey _globalKey = GlobalKey();
|
|
|
|
|
int _selectedSurah = -1;
|
|
|
|
|
int _selectedFromAya = -1;
|
|
|
|
|
int _selectedToAya = -1;
|
|
|
|
|
@ -81,9 +80,7 @@ class _QuranScreenState extends State<QuranScreen> {
|
|
|
|
|
}
|
|
|
|
|
_surahList = _surahModel.data.map((element) => element.nameAR).toList();
|
|
|
|
|
_currentPage = widget.bookmark?.page ?? 1;
|
|
|
|
|
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
//filterData();
|
|
|
|
|
} catch (ex, tr) {
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Utils.handleException(ex, null);
|
|
|
|
|
@ -113,33 +110,23 @@ class _QuranScreenState extends State<QuranScreen> {
|
|
|
|
|
filteredAyahList = List.generate(getNextMultiple(numberOfAyah), (index) => index + 1).toList().where((element) => element == 1 || (element % 5) == 0).toList() ?? [];
|
|
|
|
|
_fromAyaList = filteredAyahList.getRange(0, filteredAyahList.length - 1)?.toList() ?? [];
|
|
|
|
|
|
|
|
|
|
// _toAyaList = filteredAyahList.getRange(1, filteredAyahList.length)?.toList() ?? [];
|
|
|
|
|
// _currentPage = 0;
|
|
|
|
|
// _selectedFromAya = 0;
|
|
|
|
|
// _selectedToAya = 0;
|
|
|
|
|
setState(() {});
|
|
|
|
|
// getTangheemBySurahId();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void getTangheemBySurahId() async {
|
|
|
|
|
//Utils.showLoading(context);
|
|
|
|
|
try {
|
|
|
|
|
_ayatTangheemTypeMapped = await TangheemUserApiClient().getTangheemBySurah(_selectedSurah + 1);
|
|
|
|
|
_tangheemWords = _ayatTangheemTypeMapped?.data?.map((e) => e.highlightText)?.toList() ?? [];
|
|
|
|
|
} catch (ex, tr) {
|
|
|
|
|
Utils.handleException(ex, null);
|
|
|
|
|
} finally {
|
|
|
|
|
//Utils.hideLoading(context);
|
|
|
|
|
}
|
|
|
|
|
} finally {}
|
|
|
|
|
setState(() {});
|
|
|
|
|
//getAyaByRange();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void getAyaByRange() async {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
try {
|
|
|
|
|
_ayaModel = await TangheemUserApiClient().getAyaByFilter(_selectedSurah + 1, _fromAyaList[_selectedFromAya], _toAyaList[_selectedToAya]);
|
|
|
|
|
//setState(() {});
|
|
|
|
|
} catch (ex, tr) {
|
|
|
|
|
Utils.handleException(ex, null);
|
|
|
|
|
} finally {
|
|
|
|
|
@ -291,15 +278,6 @@ class _QuranScreenState extends State<QuranScreen> {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
// SizedBox(width: 8),
|
|
|
|
|
// commonIconButton(
|
|
|
|
|
// "مسح البحث",
|
|
|
|
|
// "assets/icons/cancel.svg",
|
|
|
|
|
// (_selectedSurah == -1 || _selectedFromAya == -1 || _selectedToAya == -1)
|
|
|
|
|
// ? null
|
|
|
|
|
// : () {
|
|
|
|
|
// _clearFilterAndRefreshData();
|
|
|
|
|
// }),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 16),
|
|
|
|
|
@ -340,56 +318,9 @@ class _QuranScreenState extends State<QuranScreen> {
|
|
|
|
|
Expanded(
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
child: RepaintBoundary(
|
|
|
|
|
key: _globalKey,
|
|
|
|
|
child: Material(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: ListView(
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
padding: EdgeInsets.only(top: 16, bottom: 8),
|
|
|
|
|
children: [
|
|
|
|
|
// Text(
|
|
|
|
|
// "بسم الله الرحمن الرحيم",
|
|
|
|
|
// textAlign: TextAlign.center,
|
|
|
|
|
// style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: ColorConsts.primaryBlue, height: 1),
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(height: 8),
|
|
|
|
|
Container(padding: EdgeInsets.only(left: 4, right: 4), child: quranText()
|
|
|
|
|
// Text(
|
|
|
|
|
// _surahAya,
|
|
|
|
|
// textAlign: TextAlign.center,
|
|
|
|
|
// style: TextStyle(
|
|
|
|
|
// fontFamily: "UthmanicHafs",
|
|
|
|
|
// fontSize: 18,
|
|
|
|
|
// color: ColorConsts.primaryBlue,
|
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// todo "sikander" : lines commented for future
|
|
|
|
|
// TextHighLightWidget(
|
|
|
|
|
// text: _surahAya,
|
|
|
|
|
// valueColor: ColorConsts.primaryBlue,
|
|
|
|
|
// highLightColor: ColorConsts.primaryBlue,
|
|
|
|
|
// highlights: _tangheemWords,
|
|
|
|
|
// onTap: (value) {
|
|
|
|
|
// List<AyatTangheemTypeMappedData> _ayatList = _ayatTangheemTypeMapped.data?.where((element) => element.highlightText == value)?.toList() ?? [];
|
|
|
|
|
// if (_ayatList.length > 1) {
|
|
|
|
|
// _selectTangheemType(_ayatList);
|
|
|
|
|
// } else {
|
|
|
|
|
// Navigator.pushNamed(context, TangheemDetailScreen.routeName, arguments: _ayatList.first);
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// style: TextStyle(
|
|
|
|
|
// fontFamily: "UthmanicHafs",
|
|
|
|
|
// fontSize: 18,
|
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.only(left: 4, right: 4),
|
|
|
|
|
child: quranText(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -421,7 +352,6 @@ class _QuranScreenState extends State<QuranScreen> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// AyaPlayerWidget(surahName: _surahList.isNotEmpty ? _surahList[_selectedSurah] : "", globalKey: _globalKey)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
@ -635,7 +565,6 @@ class _QuranScreenState extends State<QuranScreen> {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
var temp = _bookMark.firstWhere((element) => element.ayahID == _selectedAyaForBookmark.ayahID, orElse: () => null);
|
|
|
|
|
if (temp != null) {
|
|
|
|
|
//
|
|
|
|
|
Utils.showToast("هذه الأية مضافة سابقا");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|