df/frontend/app/lib/widgets/bottom_navigation_item.dart
itsscb 7750972a42 rf/replaces home_screen and login
backs up old screens to pages_old
2023-11-04 01:44:49 +01:00

46 lines
965 B
Dart

import 'package:flutter/material.dart';
class BottomNavigationItem extends StatelessWidget {
BottomNavigationItem({
super.key,
required this.onPressed,
required this.icon,
required this.color,
this.textSize,
this.iconSize,
this.label,
}) {
textSize ??= 15;
iconSize ??= 25;
}
void Function() onPressed;
IconData icon;
Color color;
double? textSize;
double? iconSize;
String? label;
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment:
label != null ? MainAxisAlignment.center : MainAxisAlignment.center,
children: [
IconButton(
onPressed: onPressed,
icon: Icon(
icon,
size: iconSize,
color: color,
)),
if (label != null)
Text(
label!,
style: TextStyle(fontSize: textSize, color: color),
),
],
);
}
}