GSAlertDialog

GSAlertDialog effectively interrupts a user's flow and prompts them to take a specific action. It's commonly used for mandatory confirmations or call-to-actions.
API Reference
This is an illustration of a Themed GSAlertDialog widget with default configuration.

    import 'package:gluestack_ui/gluestack_ui.dart';

    GSButton(
      size: GSButtonSizes.$lg,
      child: const GSButtonText(text: "Click Me"),
      onPressed: () {
        GSAlertDialog.show(
          context,
          size: GSAlertDialogSizes.$full,
          content: GSAlertDialogContent(
            header: GSAlertDialogHeader(
              style: GSStyle(
                bg: Colors.pink,
              ),
              child: const Text("Header"),
            ),
            body: const GSAlertDialogBody(
              child: Text(
                "Are you sure you want to deactivate your account? Your data will be permanently removed and cannot be undone."),
            ),
            footer: GSAlertDialogFooter(
              child: GSButtonGroup(
                buttons: [
                  GSButton(
                    action: GSButtonActions.positive,
                    variant: GSButtonVariants.outline,
                    child: const Text("Yes"),
                    onPressed: () {},
                  ),
                  GSButton(
                    action: GSButtonActions.negative,
                    variant: GSButtonVariants.outline,
                    child: const Text("No"),
                    onPressed: () {},
                  ),
                ],
              ),
            ),
          ),
        );
      },
    )


API Reference

Import

To use this component in your project, include the following import statement in your file.
import "package:gluestack_ui/gluestack_ui.dart"

Widget Parameters

This section provides a comprehensive reference list for the widget parameters, detailing descriptions, properties, types, and default behavior for easy project integration.

GSAlertDialog

Contains all Dialog related layout style properties and actions. It inherits all the properties of Flutter's Dialog widget.

GSAlertDialogContent

It contains the content for the GSAlertDialog widget i.e GSAlertDialogHeader, GSAlertDialogBody and GSAlertDialogFooter .

GSAlertDialogHeader

It inherits all the properties of Flutter's Container widget.

GSAlertDialogBody

It inherits all the properties of Flutter's Container widget.

GSAlertDialogFooter

It inherits all the properties of Flutter's Container widget.

Parameters

GSAlertDialog widget is created using Container widget from flutter. It extends all the properties supported by Flutter Container and additionally the properties mentioned below.

GSAlertDialog

Name
Value
Default
size
xs | sm | md | lg | full
md
Note: These properties are exclusively applicable when utilizing the default configuration of gluestack-ui/config. If you are using a custom theme, these properties may not be available.

GSAlertDialog with semantic icon

An example of an GSAlertDialog widget incorporating an icon widget for visually representing important information or actions.

GSAlertDialog Sizes

An GSAlertDialog widget with adjustable sizes, providing flexible and visually appealing pop-up notifications and interactive prompts to users.
Edit this page on GitHub