RetryErrorState class
Data-driven "this failed, here's why, try again" panel — composed from
EmptyStatePlaceholder (same icon-badge/title/message chrome every other
empty/error state in this kit already uses) plus an optional
AsyncCommonButton retry action, which is what actually gives "rapid tap
doesn't run the retry twice" for free (see async_common_button.dart's
own re-entry guard) — this widget adds no tap-guarding of its own.
message is the only text ever rendered — RetryErrorState.fromSdkFailure
only ever reads SdkFailure.message (documented there as the safe,
consumer-facing string), never .cause/.stackTrace. code is a
separate, optional, tappable diagnostic string (tap copies it to the
clipboard) for a support conversation — fromSdkFailure derives it
deterministically from kind+message via fnv1aHash, so the same
error always shows the same code.
onRetry left null hides the retry button entirely rather than
showing a button that does nothing.
compact controls layout only: false (default) centers the panel to
fill whatever space the caller gives it (a whole screen replaced by an
error state); true renders just the column, unwrapped, for embedding
inline (e.g. inside a smaller panel/list empty state) — no change to
EmptyStatePlaceholder itself was needed for either variant.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- RetryErrorState
Constructors
Properties
- code → String?
-
final
- color → Color?
-
final
- compact → bool
-
final
- extraAction → Widget?
-
A second, caller-supplied action rendered below retry/code — e.g. an
"Open network settings" button for a SdkErrorKind.network failure.
The kit doesn't know what that action should do for a given app, so
it's a plain slot rather than a named "offline button" with baked-in
behavior.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- message → String
-
final
-
onRetry
→ Future<
void> Function()? -
final
- retryLabel → String?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- title → String?
-
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, 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
Static Methods
-
fromSdkFailure(
SdkFailure failure, {Future< void> onRetry()?, String? retryLabel, Widget? extraAction, Color? color, bool compact = false}) → RetryErrorState