IconicaAlertDialog.icon constructor

IconicaAlertDialog.icon(
  1. {required String title,
  2. required Widget icon,
  3. required String body,
  4. required List<AlertDialogAction> buttons,
  5. bool? closeButton,
  6. ButtonCallback? primaryButton,
  7. ButtonCallback? secondaryButton,
  8. IconButtonCallback? iconButton}
)

Implementation

factory IconicaAlertDialog.icon({
  required String title,
  required Widget icon,
  required String body,
  required List<AlertDialogAction> buttons,
  bool? closeButton,
  ButtonCallback? primaryButton,
  ButtonCallback? secondaryButton,
  IconButtonCallback? iconButton,
}) =>
    IconicaAlertDialog._(
      primaryButton: primaryButton,
      secondaryButton: secondaryButton,
      iconButton: iconButton,
      closeButton: closeButton,
      buttons: buttons,
      body: (context) => Column(
        children: [
          icon,
          Padding(
            padding: const EdgeInsets.symmetric(horizontal: 20),
            child: Text(
              title,
              style: Theme.of(context).textTheme.titleLarge?.copyWith(
                    fontWeight: FontWeight.bold,
                  ),
              textAlign: TextAlign.center,
            ),
          ),
          Padding(
            padding: const EdgeInsets.only(top: 20, left: 20, right: 20),
            child: Text(
              body,
              style: Theme.of(context).textTheme.bodyMedium,
              textAlign: TextAlign.center,
            ),
          ),
        ],
      ),
    );