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