MaintenanceMode class

A widget that manages maintenance mode for the application.

It should typically be placed in the builder property of MaterialApp to ensure it wraps the entire application and can display the maintenance screen over all other routes.

Inheritance

Constructors

MaintenanceMode({Key? key, required MaintenanceConfig config, required Widget child, Widget customBuilder(BuildContext context, MaintenanceModel model)?, Widget? loadingPlaceholder, String? defaultTitle, String? defaultRetryLabel, String? defaultContactLabel, VoidCallback? onContact, Widget? defaultIcon, Color? defaultBackgroundColor, TextStyle? defaultTitleStyle, TextStyle? defaultMessageStyle, ButtonStyle? defaultRetryButtonStyle, ButtonStyle? defaultContactButtonStyle, TextStyle? defaultRetryTextStyle, TextStyle? defaultContactTextStyle, Widget? defaultRetryButtonIcon, Widget? defaultContactButtonIcon})
const

Properties

child Widget
The child widget to display when maintenance mode is not active.
final
config MaintenanceConfig
Configuration for maintenance mode, including the data source and fallback behavior.
final
customBuilder Widget Function(BuildContext context, MaintenanceModel model)?
Callback for custom maintenance screen UI. If provided, this builder is used instead of the default MaintenanceScreen.
final
defaultBackgroundColor Color?
The background color for the default MaintenanceScreen.
final
defaultContactButtonIcon Widget?
A custom icon widget for the contact button.
final
defaultContactButtonStyle ButtonStyle?
The ButtonStyle for the contact button on the default MaintenanceScreen.
final
defaultContactLabel String?
Custom Contact Button Label. Defaults to "Contact Us".
final
defaultContactTextStyle TextStyle?
The TextStyle for the contact button text.
final
defaultIcon Widget?
Custom Icon for default screen.
final
defaultMessageStyle TextStyle?
The TextStyle for the message on the default MaintenanceScreen.
final
defaultRetryButtonIcon Widget?
A custom icon widget for the retry button.
final
defaultRetryButtonStyle ButtonStyle?
The ButtonStyle for the retry button on the default MaintenanceScreen.
final
defaultRetryLabel String?
Custom title for default retry label.
final
defaultRetryTextStyle TextStyle?
The TextStyle for the retry button text.
final
defaultTitle String?
Custom Title for default screen. Defaults to "Maintenance Mode".
final
defaultTitleStyle TextStyle?
The TextStyle for the title on the default MaintenanceScreen.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loadingPlaceholder Widget?
Custom loading placeholder displayed while fetching the maintenance status.
final
onContact VoidCallback?
Callback for the Contact Us button. If null, the button is hidden.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<MaintenanceMode>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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