native static method
Native Buttons
Implementation
static Widget native({
Function? onPressed,
String? label,
Color? labelColor,
Color? bgColor,
double? widthFactor,
}) {
if (Platform.isIOS) {
return FractionallySizedBox(
widthFactor: widthFactor,
child: CupertinoButton(
color: bgColor,
child: Text(
label!,
style: TextStyle(
color: labelColor,
),
),
onPressed: onPressed as void Function()?,
),
);
} else {
return FractionallySizedBox(
widthFactor: widthFactor,
child: TextButton(
child: Text(
label!,
style: TextStyle(
color: labelColor ?? Colors.black,
),
),
onPressed: onPressed as void Function()?,
style: TextButton.styleFrom(
backgroundColor: bgColor,
),
),
);
}
}