GenericErrorWidget class
GenericErrorWidget is a generic used to purposefully communicate that
the value of the data received from the API was null
or it missed
key properties that are of a valid response.
Because of it;s generic natures, this widget handles the following types
of error defined under GenericNoDataTypes enum
- AbsentData -> no data completely
- ErrorInData -> there was an error in the received data or the API returned with an error attribute
When the errorType is of type ErrorInData
a specific illustration will
be shown in place of the default one.
Always, a recoverCallback can be defined to offset the user a way out
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- GenericErrorWidget
Constructors
-
GenericErrorWidget({Key? key, required VoidCallback? recoverCallback, String? messageTitle, List<
TextSpan> ? messageBody, String actionText = retryString, MainAxisAlignment? align, GenericNoDataTypes type = GenericNoDataTypes.error, String? headerIconSvgUrl, EdgeInsets? padding, Key? actionKey, bool showPrimaryButton = true}) -
const
Properties
- actionKey → Key?
-
final
- actionText → String
-
actionText
final
- align → MainAxisAlignment?
-
align where the error widget should align
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- headerIconSvgUrl → String?
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
messageBody
→ List<
TextSpan> ? -
messageTitle to show in the body, in place of the default one
final
- messageTitle → String?
-
messageTitle to show on the title, in place of the default one
final
- padding → EdgeInsets?
-
final
- recoverCallback → VoidCallback?
-
recoverCallback the function to be called to recover from the error.
Default to
null
final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showPrimaryButton → bool
-
final
- type → GenericNoDataTypes
-
type the type of error. Defaults to
noData
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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}) → 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