import 'package:flutter/material.dart';

class CustomTextButton extends StatelessWidget {
  final Color backgroundColor;
  final Color disabledColor;
  final void Function() onPressed;
  final void Function() onLongPress;
  final void Function(bool) onHover;
  final Widget child;
  final OutlinedBorder shape;
  final double elevation;
  final BorderSide side;
  final Color disabledForegroundColor;
  final Color disabledBackgroundColor;

  const CustomTextButton({
    Key key,
    this.backgroundColor,
    this.disabledColor,
    this.onPressed,
    this.onLongPress,
    this.onHover,
    this.child,
    this.shape,
    this.elevation,
    this.side,
    this.disabledForegroundColor = const Color(0x61bcc2c4),
    this.disabledBackgroundColor = const Color(0x1Fbcc2c4),
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return TextButton(
      style: TextButton.styleFrom(
        backgroundColor: backgroundColor,
        shape: shape ?? RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
        disabledForegroundColor: disabledForegroundColor,
        disabledBackgroundColor: disabledBackgroundColor,
        elevation: elevation,
        side: side,
      ),
      onPressed: onPressed,
      child: child,
    );
  }
}
