SAppState class

A highly customizable component for displaying application states (e.g., empty, error, server down) with dynamic illustrations and entrance animations.

Inheritance

Constructors

SAppState({Key? key, SAppStateVariant variant = SAppStateVariant.noData, String? title, String? description, Widget? titleWidget, Widget? descriptionWidget, Widget? customIllustration, Size? illustrationSize, List<Widget>? actions, EdgeInsetsGeometry? padding, double? elementSpacing, MainAxisAlignment? mainAxisAlignment, CrossAxisAlignment? crossAxisAlignment, bool animate = true})
Creates a default SAppState displaying the provided variant.
const
SAppState.addNotes({Key? key, String? title, String? description, Widget? titleWidget, Widget? descriptionWidget, Size? illustrationSize, List<Widget>? actions, EdgeInsetsGeometry? padding, double? elementSpacing, MainAxisAlignment? mainAxisAlignment, CrossAxisAlignment? crossAxisAlignment, bool animate = true})
Variant for 'Add Notes' state.
const
SAppState.arrowPointer({Key? key, String? title, String? description, Widget? titleWidget, Widget? descriptionWidget, Size? illustrationSize, List<Widget>? actions, EdgeInsetsGeometry? padding, double? elementSpacing, MainAxisAlignment? mainAxisAlignment, CrossAxisAlignment? crossAxisAlignment, bool animate = true})
Variant for 'Arrow Pointer' state.
const
SAppState.emptyNotification({Key? key, String? title, String? description, Widget? titleWidget, Widget? descriptionWidget, Size? illustrationSize, List<Widget>? actions, EdgeInsetsGeometry? padding, double? elementSpacing, MainAxisAlignment? mainAxisAlignment, CrossAxisAlignment? crossAxisAlignment, bool animate = true})
Variant for 'Empty Notification' state.
const
SAppState.failedServer({Key? key, String? title, String? description, Widget? titleWidget, Widget? descriptionWidget, Size? illustrationSize, List<Widget>? actions, EdgeInsetsGeometry? padding, double? elementSpacing, MainAxisAlignment? mainAxisAlignment, CrossAxisAlignment? crossAxisAlignment, bool animate = true})
Variant for 'Failed Server' state.
const
SAppState.noCalendar({Key? key, String? title, String? description, Widget? titleWidget, Widget? descriptionWidget, Size? illustrationSize, List<Widget>? actions, EdgeInsetsGeometry? padding, double? elementSpacing, MainAxisAlignment? mainAxisAlignment, CrossAxisAlignment? crossAxisAlignment, bool animate = true})
Variant for 'No Calendar' state.
const
SAppState.noData({Key? key, String? title, String? description, Widget? titleWidget, Widget? descriptionWidget, Size? illustrationSize, List<Widget>? actions, EdgeInsetsGeometry? padding, double? elementSpacing, MainAxisAlignment? mainAxisAlignment, CrossAxisAlignment? crossAxisAlignment, bool animate = true})
Variant for 'No Data' state.
const
SAppState.underConstruction({Key? key, String? title, String? description, Widget? titleWidget, Widget? descriptionWidget, Size? illustrationSize, List<Widget>? actions, EdgeInsetsGeometry? padding, double? elementSpacing, MainAxisAlignment? mainAxisAlignment, CrossAxisAlignment? crossAxisAlignment, bool animate = true})
Variant for 'Under Construction' state.
const

Properties

actions List<Widget>?
Optional list of action buttons (e.g., Retry, Go Back).
final
animate bool
Whether to show an entrance animation.
final
crossAxisAlignment CrossAxisAlignment?
Cross axis alignment of the elements.
final
customIllustration Widget?
A custom illustration to use when variant is SAppStateVariant.custom.
final
description String?
Optional description text. If descriptionWidget is provided, this is ignored.
final
descriptionWidget Widget?
A custom widget to use as the description, overriding description.
final
elementSpacing double?
Vertical spacing between the illustration, title, description, and actions.
final
hashCode int
The hash code for this object.
no setterinherited
illustrationSize Size?
The size of the illustration.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
mainAxisAlignment MainAxisAlignment?
Main axis alignment of the elements.
final
padding EdgeInsetsGeometry?
Padding around the entire state widget.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String?
Optional title text. If titleWidget is provided, this is ignored.
final
titleWidget Widget?
A custom widget to use as the title, overriding title.
final
variant SAppStateVariant
The variant determining which predefined illustration to show.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<SAppState>
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