QOL: Add Long Press to mih button

This commit is contained in:
2025-10-16 09:46:02 +02:00
parent 6ecce1e9ff
commit 5f5107ee99

View File

@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
class MihButton extends StatelessWidget { class MihButton extends StatelessWidget {
final void Function()? onPressed; final void Function()? onPressed;
final void Function()? onLongPressed;
final Color buttonColor; final Color buttonColor;
final double? width; final double? width;
final double? height; final double? height;
@@ -12,6 +13,7 @@ class MihButton extends StatelessWidget {
const MihButton({ const MihButton({
super.key, super.key,
required this.onPressed, required this.onPressed,
this.onLongPressed,
required this.buttonColor, required this.buttonColor,
this.width, this.width,
this.height, this.height,
@@ -49,6 +51,7 @@ class MihButton extends StatelessWidget {
highlightColor: rippleColor.withValues(alpha: 0.2), highlightColor: rippleColor.withValues(alpha: 0.2),
hoverColor: rippleColor.withValues(alpha: 0.3), hoverColor: rippleColor.withValues(alpha: 0.3),
onTap: onPressed, onTap: onPressed,
onLongPress: onLongPressed,
child: Container( child: Container(
width: width, width: width,
height: height, height: height,