Modular UI Documentation
  • Modular UI
  • Buttons
    • MUIPrimary Button
    • MUIOutlined Button
    • MUIGradient Button
    • MUILoading Button
    • MUISecondary Button
    • MUISecondaryOutlined Button
    • MUIText Button
    • MUIPrimaryBlock Button
    • MUISecondaryBlock Button
    • MUILoadingBlock Button
    • MUIGradientBlock Button
    • MUITextBlock Button
    • MUIOutlinedBlock Button
  • Cards
    • MUIPrimary Card
    • MUIBlog Card
    • MUISimple Card
    • MUIPricing Card
    • MUIProfile Card
    • MUISignIn Card
    • MUISignUp Card
  • Carousels
  • Avatars
  • Breadcrumbs
  • CheckBox
  • Dialog
  • Input Field
  • Listtile
  • Rating
  • Slider
  • Switch
  • Tabs
Powered by GitBook
On this page
  • Dialog
  • MUIPrimaryDialog
  • Properties
  • Methods
  • Example Usage
  • Notes

Dialog

Dialog

MUIPrimaryDialog

A customizable primary dialog provided by Modular UI.

Properties

  • titleText: String - Title of the dialog box that appears at the top.

  • contentText: String - The main content of the dialog box.

  • dialogRadius: double? - Border radius of the dialog box; default: 5.

  • dialogBackgroundColor: Color? - Color of the dialog box; default: white.

  • titleStyle: TextStyle? - Text style of the dialog box title; default: size=18, bold, color=black.

  • contentStyle: TextStyle? - Text style of the dialog box content; default: color=black54.

  • buttons: List? - List of buttons or widgets to be shown in the primary dialog box.

  • buttonsAlignment: MainAxisAlignment? - Main axis alignment for buttons.

Methods

showDialogBox(BuildContext context)

Displays the primary dialog box.

Parameters

  • context: BuildContext - The build context of the widget.

Returns

  • Future - A Future that resolves to the result returned by the showDialog function.

Example Usage

MUISecondaryOutlinedButton(
        text: 'Show Dialog Box',
        borderColor: Colors.grey.shade300,
        bgColor: Colors.white,
        onPressed: () {
          MUIPrimaryDialog(
              titleText: 'Alert Dialog',
              contentText:
                  'This action cannot be undone. This will permanently delete your account and remove your data from our servers.',
              buttonsAlignment: MainAxisAlignment.spaceEvenly,
              buttons: [
                MUISecondaryButton(
                    text: 'Cancel',
                    onPressed: () {
                      Navigator.pop(context);
                    }),
                MUISecondaryOutlinedButton(
                  text: 'Done',
                  onPressed: () {},
                  bgColor: Colors.grey.shade200,
                  borderColor: Colors.grey.shade300,
                )
              ]).showDialogBox(context);
        },
      ),

Notes

  • Provides a customizable dialog box with title, content, and action buttons.

  • Supports customization of dialog box appearance, including title and content text styles.

  • Allows the addition of action buttons with various styles and functionalities.

PreviousCheckBoxNextInput Field

Last updated 1 year ago