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,36 +220,40 @@ 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
crossAxisAlignment: CrossAxisAlignment.center, ? SizedBox()
mainAxisSize: MainAxisSize.min, : Row(
children: [ crossAxisAlignment: CrossAxisAlignment.center,
SvgPicture.asset(icon, height: 12, width: 12), mainAxisSize: MainAxisSize.min,
SizedBox(width: 4), children: [
Text( SvgPicture.asset(icon, height: 12, width: 12),
text, SizedBox(width: 4),
style: TextStyle(color: ColorConsts.textGrey), Text(
), text,
], style: TextStyle(color: ColorConsts.textGrey),
), ),
],
),
); );
} }
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
crossAxisAlignment: CrossAxisAlignment.center, ? SizedBox()
mainAxisSize: MainAxisSize.min, : Row(
children: [ crossAxisAlignment: CrossAxisAlignment.center,
Text( mainAxisSize: MainAxisSize.min,
text, children: [
style: TextStyle(color: ColorConsts.textGrey), Text(
), text,
SizedBox(width: 4), style: TextStyle(color: ColorConsts.textGrey),
SvgPicture.asset(icon, height: 12, width: 12), ),
], SizedBox(width: 4),
), SvgPicture.asset(icon, height: 12, width: 12),
],
),
); );
} }
} }

Loading…
Cancel
Save