improvements.

development
Sikander Saleem 5 years ago
parent aac94f590f
commit b0ed7662d5

@ -118,7 +118,7 @@ class _SurahScreenState extends State<SurahScreen> {
if (_selectedFromAya != index) { if (_selectedFromAya != index) {
_selectedFromAya = index; _selectedFromAya = index;
_selectedToAya = index; _selectedToAya = index;
filterData(); getAyaByRange();
} }
}), }),
), ),
@ -127,7 +127,7 @@ class _SurahScreenState extends State<SurahScreen> {
child: CommonDropDownButton(_selectedToAya, list: _toAyaList.map((e) => "الى الاية" + " $e").toList(), onSelect: (index) { child: CommonDropDownButton(_selectedToAya, list: _toAyaList.map((e) => "الى الاية" + " $e").toList(), onSelect: (index) {
if (_selectedToAya != index) { if (_selectedToAya != index) {
_selectedToAya = index; _selectedToAya = index;
filterData(); getAyaByRange();
} }
}), }),
), ),
@ -147,8 +147,24 @@ class _SurahScreenState extends State<SurahScreen> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
nextOptionButton("assets/icons/prev.svg", "سورة الفاتحة", () {}), nextOptionButton(
previousOptionButton("assets/icons/next.svg", "سورة آل عمران", () {}), "assets/icons/prev.svg",
_selectedSurah == 0 ? "" : _surahList[_selectedSurah - 1],
_selectedSurah == 0
? null
: () {
_selectedSurah = _selectedSurah - 1;
filterData();
}),
previousOptionButton(
"assets/icons/next.svg",
_selectedSurah == (_surahList.length) ? "" : _surahList[_selectedSurah + 1],
_selectedSurah == (_surahList.length)
? null
: () {
_selectedSurah = _selectedSurah + 1;
filterData();
}),
], ],
), ),
Expanded( Expanded(
@ -204,7 +220,9 @@ class _SurahScreenState extends State<SurahScreen> {
Widget nextOptionButton(String icon, String text, VoidCallback onPressed) { Widget nextOptionButton(String icon, String text, VoidCallback onPressed) {
return InkWell( return InkWell(
onTap: onPressed, onTap: onPressed,
child: Row( child: onPressed == null
? SizedBox()
: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
@ -222,7 +240,9 @@ class _SurahScreenState extends State<SurahScreen> {
Widget previousOptionButton(String icon, String text, VoidCallback onPressed) { Widget previousOptionButton(String icon, String text, VoidCallback onPressed) {
return InkWell( return InkWell(
onTap: onPressed, onTap: onPressed,
child: Row( child: onPressed == null
? SizedBox()
: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [

Loading…
Cancel
Save