showAnimatedFastAlertDialog<T extends Object?> function

Future<T?> showAnimatedFastAlertDialog<T extends Object?>({
  1. required BuildContext context,
  2. String? titleText,
  3. bool barrierDismissible = true,
  4. Color? backgroundColor,
  5. List<Widget>? children,
  6. VoidCallback? onCancel,
  7. List<Widget>? actions,
  8. VoidCallback? onValid,
  9. String? messageText,
  10. String? cancelText,
  11. String? validText,
  12. Color? titleColor,
  13. bool? showCancel,
  14. bool? showValid,
})

Implementation

Future<T?> showAnimatedFastAlertDialog<T extends Object?>({
  required BuildContext context,
  String? titleText,
  bool barrierDismissible = true,
  Color? backgroundColor,
  List<Widget>? children,
  VoidCallback? onCancel,
  List<Widget>? actions,
  VoidCallback? onValid,
  String? messageText,
  String? cancelText,
  String? validText,
  Color? titleColor,
  bool? showCancel,
  bool? showValid,
}) {
  return showGeneralDialog<T>(
    barrierDismissible: barrierDismissible,
    barrierLabel: kFastEmptyString,
    context: context,
    pageBuilder: (_, __, ___) => SafeArea(
      child: FastAlertDialog(
        titleText: titleText,
        cancelText: cancelText,
        validText: validText,
        showValid: showValid,
        showCancel: showCancel,
        titleColor: titleColor,
        actions: actions,
        backgroundColor: backgroundColor,
        onValid: onValid,
        onCancel: onCancel,
        messageText: messageText,
        children: children,
      ),
    ),
    transitionBuilder: (ctx, a1, a2, child) {
      final curve = Curves.linear.transform(a1.value);

      return Transform.scale(scale: curve, child: child);
    },
    transitionDuration: const Duration(milliseconds: 300),
  );
}