You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.3 KiB
Dart
47 lines
1.3 KiB
Dart
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!,
|
|
);
|
|
}
|
|
}
|