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({
Key? key,
required this.middleText,
required this.onNextCard,
required this.onPreviousCard,
2022-02-04 04:22:35 +01:00
this.onMiddlePressed,
2022-02-02 23:45:37 +01:00
}) : super(key: key);
@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
.headline6!
.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),
),
],
),
);
}