defaultControlButtons function
Implementation
Widget defaultControlButtons(
BuildContext context,
Function? skip,
Function? next,
int index,
int total,
String finishWording,
String nextWording,
String skipWording,
Color? textColor) {
return Wrap(
spacing: 8.0,
runSpacing: 8.0,
children: [
if (skip != null)
(OutlinedButton(
style: textColor != null
? OutlinedButton.styleFrom(
side: BorderSide(width: 1.0, color: textColor),
)
: null,
child: Text(
index + 1 == total ? finishWording : skipWording,
style: Theme.of(context).textTheme.labelMedium,
),
onPressed: () => skip(),
)),
if (next != null && index + 1 < total)
(ElevatedButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(
Theme.of(context).colorScheme.outline.withAlpha(150))),
child: Text(
"$nextWording (${index + 1}/$total)",
style: Theme.of(context).textTheme.labelMedium,
),
onPressed: () => next(),
)),
],
);
}