previousAndNextButtonsWithScroll static method
Implementation
static Widget previousAndNextButtonsWithScroll(
int index,
int lastIndex,
List<dynamic> tours,
Config config,
ScrollController? scrollController,
Map<dynamic, dynamic> gkeys,
) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: index == 0
? null
: () async {
if (scrollController != null) {
final prevKey =
gkeys[tours[index - 1]["selector"].toString()];
await scrollToTarget(prevKey, scrollController);
}
TourUtil.previous();
},
child: Text(index == 0 ? '' : 'Previous'),
),
GestureDetector(
onTap: index == lastIndex
? null
: () async {
if (scrollController != null) {
final nextKey =
gkeys[tours[index + 1]["selector"].toString()];
await scrollToTarget(nextKey, scrollController);
}
TourUtil.next();
},
child: Text(index == lastIndex ? '' : 'Next'),
),
],
);
}