showToastCx static method
void
showToastCx(
- BuildContext context, {
- Widget? child,
- String? title,
- Duration? toastDuration,
- ToastGravity? gravity,
Implementation
static void showToastCx(
BuildContext context, {
Widget? child,
String? title,
Duration? toastDuration,
ToastGravity? gravity,
}) {
FToast()
..init(context)
..showToast(
child: child ??
Container(
padding:
const EdgeInsets.symmetric(horizontal: 24.0, vertical: 12.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25.0),
color: tsBgColor ?? Colors.black.withOpacity(0.5),
),
child: Text(
title ?? '',
style: Styles.copyStyle(color: tsTxColor ?? Colors.white),
),
),
toastDuration: toastDuration ?? const Duration(seconds: 3),
gravity: gravity ?? ToastGravity.CENTER,
);
}