ayat num reverse method added.

development
Sikander Saleem 5 years ago
parent 5790adf6d2
commit 7100682eda

@ -105,4 +105,11 @@ class AyaModelData {
data['eighths_ID'] = this.eighthsID;
return data;
}
String reverseAyatNumber() {
String _ayaTemp = ayahText.substring(0, ayahText.length - numberInSurah.toString().length);
String _ayaNum = ayahText.substring(ayahText.length - numberInSurah.toString().length, ayahText.length);
_ayaNum = _ayaNum.split('').reversed.join('');
return "$_ayaTemp$_ayaNum";
}
}

@ -86,7 +86,7 @@ class _QuranScreenState extends State<QuranScreen> {
// _selectedFromAya = 0;
// _selectedToAya = 0;
setState(() {});
//getTangheemBySurahId();
// getTangheemBySurahId();
}
void getTangheemBySurahId() async {
@ -107,19 +107,19 @@ class _QuranScreenState extends State<QuranScreen> {
Utils.showLoading(context);
try {
_ayaModel = await TangheemUserApiClient().getAyaByFilter(_selectedSurah + 1, _fromAyaList[_selectedFromAya], _toAyaList[_selectedToAya]);
setState(() {});
//setState(() {});
} catch (ex, tr) {
Utils.handleException(ex, null);
} finally {
Utils.hideLoading(context);
}
getTangheemBySurahId();
scrollToId.animateTo("$_currentPage", duration: Duration(milliseconds: 300), curve: Curves.ease);
}
void getQuranByPageNo() async {
Utils.showLoading(context);
try {
// _currentPage = 603;
_ayaModel = await TangheemUserApiClient().getQuranByPageNo(_currentPage);
Utils.hideLoading(context);
setState(() {});
@ -181,7 +181,7 @@ class _QuranScreenState extends State<QuranScreen> {
String _surahAya = "";
_ayaModel?.data?.forEach((element) {
var temp = element.numberInSurah == 1 ? getBismillahWithSurahName(element.surahNameAR, element.surahID != 1, _surahAya.length <= 1) + element.ayahText : element.ayahText;
var temp = element.numberInSurah == 1 ? getBismillahWithSurahName(element.surahNameAR, element.surahID != 1, _surahAya.length <= 1) + element.reverseAyatNumber() : element.reverseAyatNumber();
_surahAya = _surahAya + temp;
});
@ -312,35 +312,37 @@ class _QuranScreenState extends State<QuranScreen> {
// SizedBox(height: 8),
Container(
padding: EdgeInsets.only(left: 4, right: 4),
child: 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,
// 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);
// }
// },
child:
// 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,
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,
),
),
),
],
),

@ -47,10 +47,10 @@ class _AyaPlayerWidgetState extends State<AyaPlayerWidget> {
try {
final _playlist = ConcatenatingAudioSource(children: [
AudioSource.uri(
Uri.parse("https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_1MG.mp3"),
Uri.parse("https://server6.mp3quran.net/thubti/109.mp3"),
),
]);
var voiceList = [AudioSource.uri(Uri.parse("https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3"))];
var voiceList = [AudioSource.uri(Uri.parse("https://server6.mp3quran.net/thubti/109.mp3"))];
// if ((widget.voiceNoteList?.length ?? 0) > 0) {
// voiceList = widget.voiceNoteList.map((e) => AudioSource.uri(Uri.parse(e.exposeFilePath))).toList();

Loading…
Cancel
Save