yokutango-mobile-reader/lib/screens/practise/navigation_buttons.dart

50 lines
1.5 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;
const NavigationButtons({
Key? key,
required this.middleText,
required this.onNextCard,
required this.onPreviousCard,
}) : 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),
Text(
middleText,
style: Theme.of(context)
.textTheme
.headline6!
.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),
),
],
),
);
}