FXDialog constructor

FXDialog(
  1. BuildContext context, {
  2. double radius = 8,
  3. Widget? lottieIcon,
  4. Color buttonColor = Colors.blue,
  5. Color backgroundColor = Colors.white,
  6. TextStyle style = const TextStyle(),
  7. TextAlign textAlign = TextAlign.center,
  8. String message = "Custom dialog message",
  9. DialogType dialogType = DialogType.success,
  10. EdgeInsets padding = const EdgeInsets.all(12),
  11. TextStyle titleStyle = const TextStyle(fontSize: 18),
  12. BoxConstraints constraints = const BoxConstraints(maxWidth: 400),
  13. void onCancel()?,
  14. dynamic onConfirm()?,
  15. bool repeatAnimation = true,
  16. bool disableBackButton = false,
})

Implementation

FXDialog(
  BuildContext context, {
  double radius = 8,
  Widget? lottieIcon,
  Color buttonColor = Colors.blue,
  Color backgroundColor = Colors.white,
  TextStyle style = const TextStyle(),
  TextAlign textAlign = TextAlign.center,
  String message = "Custom dialog message",
  DialogType dialogType = DialogType.success,
  EdgeInsets padding = const EdgeInsets.all(12),
  TextStyle titleStyle = const TextStyle(fontSize: 18),
  BoxConstraints constraints = const BoxConstraints(maxWidth: 400),
  void Function()? onCancel,
  Function()? onConfirm,
  bool repeatAnimation = true,
  bool disableBackButton = false,
}) {
  showDialog(
    context: context,
    barrierDismissible: false,
    builder: (BuildContext context) => WillPopScope(
      onWillPop: () async => disableBackButton ? false : true,
      child: FXInfoDialog(
        style: style,
        radius: radius,
        message: message,
        padding: padding,
        onCancel: onCancel,
        onConfirm: onConfirm,
        lottieIcon: lottieIcon,
        titleStyle: titleStyle,
        dialogType: dialogType,
        buttonColor: buttonColor,
        constraints: constraints,
        repeatAnimation: repeatAnimation,
        backgroundColor: backgroundColor,
        textAlign: textAlign,
      ),
    ),
  );
}