LoaderButton constructor
LoaderButton({
- Key? key,
- required String text,
- required bool isLoading,
- VoidCallback? onTap,
- Color? backgroundColor,
- Color? textColor,
- double? width,
- double? height,
- double? fontSize,
- double? borderRadius,
- double? elevation,
- EdgeInsetsGeometry? margin,
- EdgeInsetsGeometry? padding,
Implementation
LoaderButton({
super.key,
required String text,
required bool isLoading,
VoidCallback? onTap,
Color? backgroundColor,
Color? textColor,
double? width,
double? height,
double? fontSize,
double? borderRadius,
double? elevation,
EdgeInsetsGeometry? margin,
EdgeInsetsGeometry? padding,
}) : super(
text: text,
onTap: onTap,
backgroundColor: backgroundColor,
textColor: textColor,
width: width,
height: height,
fontSize: fontSize,
borderRadius: borderRadius,
elevation: elevation,
margin: margin,
padding: padding,
isLoading: isLoading, // 🔑 use base class loader toggle
// show loader **beside** text
leading: isLoading
? SizedBox(
height: 18,
width: 18,
child: CircularProgressIndicator(
color: textColor ?? ColorResource.whiteColor,
strokeWidth: 2,
),
)
: null,
);