showToastCx static method

void showToastCx(
  1. BuildContext context, {
  2. Widget? child,
  3. String? title,
  4. Duration? toastDuration,
  5. 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,
    );
}