ModernDialog class

Constructors

ModernDialog.showInfo(BuildContext context, {String? title, required Widget content, String? buttonTitle = "Ok", Color? mainButtonColor, bool dismissibleDialog = true, Color? backgroundColor = Colors.white, bool? disableTintColor = false})
Info Dialog
ModernDialog.showStandard(BuildContext context, {Widget? icon, String? title, required Widget content, required String? buttonTitle, required dynamic onAccept()?, dynamic onCancel()?, Color? mainButtonColor, Color? cancelButtonColor, String? cancelButtonTitle = "Cancel", bool? shouldCloseOnMainButton = true, bool dismissibleDialog = true, Color? backgroundColor = Colors.white, bool? disableTintColor = false})
Standard Dialog
ModernDialog.showTrailingAction(BuildContext context, {String? title, required Widget content, required String? buttonTitle, required dynamic onAccept()?, String? trailingButtonTitle, dynamic onTrailingPressed()?, Color? trailingButtonColor, Color? mainButtonColor, bool dismissibleDialog = true, Color? backgroundColor = Colors.white, bool? disableTintColor = false})
Two Action Dialog
ModernDialog.showVerticalDialog(BuildContext context, {Widget? icon, String? title, required Widget content, required List<DialogButton> buttons, bool dismissibleDialog = true, Color? backgroundColor = Colors.white, bool? disableTintColor = false})
Vertical Dialog

Properties

backgroundColor Color?
Dialog background color
getter/setter pair
buttonTitle String?
Main button title
getter/setter pair
cancelButtonColor Color?
Cancel button color
getter/setter pair
cancelButtonTitle String?
Cancel button title
getter/setter pair
content Widget
Widget showing the dialog's content
getter/setter pair
disableTintColor bool?
Disables the color tint applied on the background color. false by default. (only in material design 3)
getter/setter pair
dismissibleDialog bool
Allow dialog to be dismissible
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
icon Widget?
Dialog icon showing at the top center
getter/setter pair
mainButtonColor Color?
Main button color
getter/setter pair
onAccept ↔ (dynamic Function()?)
Function to handle main button click
getter/setter pair
onCancel ↔ (dynamic Function()?)
Perform an action on closing the dialog
getter/setter pair
onTrailingPressed ↔ (dynamic Function()?)
Function when the trailing button is pressed (secondary button)
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shouldCloseOnMainButton bool?
Close the dialog when pressing the main button. true by default
getter/setter pair
title String?
Dialog's Title
getter/setter pair
trailingButtonColor Color?
Custom trailing button color
getter/setter pair
trailingButtonTitle String?
Text for the trailing button (secondary button)
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

showCustom(BuildContext context, {required Widget view, bool disablePadding = false, double? borderRadius, bool dismissibleDialog = true, Color backgroundColor = Colors.white, bool disableTintColor = false}) → dynamic
Custom Dialog