import 'package:flutter/material.dart'; class NavigationButtons extends StatelessWidget { final String middleText; final void Function() onNextCard; final void Function() onPreviousCard; final void Function()? onMiddlePressed; const NavigationButtons({ super.key, required this.middleText, required this.onNextCard, required this.onPreviousCard, this.onMiddlePressed, }); @override Widget build(BuildContext context) => Container( decoration: BoxDecoration( color: Colors.blue, borderRadius: BorderRadius.circular(10), ), child: ButtonBar( alignment: MainAxisAlignment.center, children: [ IconButton( padding: const EdgeInsets.all(20), color: Colors.white, onPressed: onPreviousCard, icon: const Icon(Icons.arrow_back), ), const SizedBox(width: 10), InkWell( onTap: onMiddlePressed, child: Padding( padding: const EdgeInsets.all(10), child: Text( middleText, style: Theme.of(context) .textTheme .headlineSmall! .merge(const TextStyle(color: Colors.white)), ), ), ), const SizedBox(width: 10), IconButton( padding: const EdgeInsets.all(20), color: Colors.white, onPressed: onNextCard, icon: const Icon(Icons.arrow_forward), ), ], ), ); }