58 lines
1.4 KiB
Dart
58 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_svg/svg.dart';
|
|
|
|
class MenuButton extends StatelessWidget {
|
|
final String? label;
|
|
final String? icon;
|
|
final VoidCallback? onPress;
|
|
final bool? isSelected;
|
|
final double? w;
|
|
final double? h;
|
|
|
|
const MenuButton({
|
|
super.key,
|
|
this.label,
|
|
this.icon,
|
|
this.onPress,
|
|
this.isSelected,
|
|
this.w,
|
|
this.h,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Expanded(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
IconButton(
|
|
icon: SvgPicture.asset(
|
|
icon ?? '',
|
|
width: w ?? 28,
|
|
height: h ?? 28,
|
|
// allowDrawingOutsideViewBox: true,
|
|
colorFilter: ColorFilter.mode(
|
|
(isSelected ?? false)
|
|
? Color.fromARGB(255, 216, 182, 10)
|
|
: Color.fromARGB(255, 255, 255, 255),
|
|
BlendMode.srcIn,
|
|
),
|
|
),
|
|
onPressed: onPress,
|
|
),
|
|
Text(
|
|
label ?? '',
|
|
style: TextStyle(
|
|
color:
|
|
(isSelected ?? false)
|
|
? Color.fromARGB(255, 216, 182, 10)
|
|
: Color.fromARGB(255, 239, 224, 232),
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|