mirror of
https://github.com/friebetill/TubeCards.git
synced 2025-08-15 02:26:03 +08:00
37 lines
888 B
Dart
37 lines
888 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class BottomNavigationButton extends StatelessWidget {
|
|
const BottomNavigationButton({
|
|
required this.onTap,
|
|
required this.icon,
|
|
required this.label,
|
|
required this.isSelected,
|
|
Key? key,
|
|
}) : super(key: key);
|
|
|
|
final VoidCallback onTap;
|
|
final IconData icon;
|
|
final String label;
|
|
final bool isSelected;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final color = isSelected
|
|
? Theme.of(context).colorScheme.primary
|
|
: Theme.of(context).iconTheme.color;
|
|
final labelStyle =
|
|
Theme.of(context).textTheme.bodyText2!.copyWith(color: color);
|
|
|
|
return InkResponse(
|
|
onTap: onTap,
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Icon(icon, color: color),
|
|
Text(label, style: labelStyle),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|