yokutango-mobile-reader/lib/components/navigation_buttons.dart

58 lines
1.8 KiB
Dart
Raw Normal View History

2022-02-02 23:45:37 +01:00
import 'package:flutter/material.dart';
class NavigationButtons extends StatelessWidget {
final String middleText;
final void Function() onNextCard;
final void Function() onPreviousCard;
2022-02-04 04:22:35 +01:00
final void Function()? onMiddlePressed;
2022-02-02 23:45:37 +01:00
const NavigationButtons({
2024-04-26 01:14:49 +02:00
super.key,
2022-02-02 23:45:37 +01:00
required this.middleText,
required this.onNextCard,
required this.onPreviousCard,
2022-02-04 04:22:35 +01:00
this.onMiddlePressed,
2024-04-26 01:14:49 +02:00
});
2022-02-02 23:45:37 +01:00
@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),
2022-02-04 04:22:35 +01:00
InkWell(
onTap: onMiddlePressed,
child: Padding(
padding: const EdgeInsets.all(10),
child: Text(
middleText,
style: Theme.of(context)
.textTheme
2024-04-26 01:14:49 +02:00
.headlineSmall!
2022-02-04 04:22:35 +01:00
.merge(const TextStyle(color: Colors.white)),
),
),
2022-02-02 23:45:37 +01:00
),
const SizedBox(width: 10),
IconButton(
padding: const EdgeInsets.all(20),
color: Colors.white,
onPressed: onNextCard,
icon: const Icon(Icons.arrow_forward),
),
],
),
);
}