ReplitErrorState class

A failure surface: an error glyph and a host-written explanation on a hairline card, with an optional retry pill.

ReplitErrorState(
  title: 'Connection error',
  message: 'The API is overloaded right now. Retry in a moment.',
  retryLabel: 'Retry',
  onRetry: resend,
)

In a thread this renders on its own: a ReplitErrorPart in any turn becomes this card, and a failed assistant turn closes with a default one even when the host supplies no part. Standalone it serves the other failure surfaces — a thread that failed to load, a connection notice pinned in ReplitChatView.aboveComposer, a failed send below the composer.

Retry reports intent; what it means — re-run the turn, refetch, reconnect — is the host's business. The affordance is a visible pill rather than a hover-revealed action, because hover does not exist on touch. The package ships no strings: title, message and retryLabel are host-localized, and retryLabel doubles as the pill's accessible name.

Inheritance

Constructors

ReplitErrorState({Key? key, String? title, String? message, VoidCallback? onRetry, String? retryLabel, EdgeInsetsGeometry? padding, BorderRadius? borderRadius, ReplitErrorStateStyle? style})
const

Properties

borderRadius → BorderRadius?
The card's corner. Defaults to the design's 12.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
message → String?
The failure, host-written and sentence-case. Announced to assistive tech as a live region, since failures arrive unprompted.
final
onRetry → VoidCallback?
Retry intent. Null hides the pill.
final
padding → EdgeInsetsGeometry?
Inside the card. Defaults to the design's 16/14.
final
retryLabel → String?
Host-localized pill label and accessible name; null renders the glyph alone.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
style → ReplitErrorStateStyle?
Per-instance restyling, merged over ReplitTheme.errorStateStyle's fields; nulls fall through to the theme tokens.
final
title → String?
Host-localized headline, e.g. 'Connection error'. Null lets message take the glyph row; without a message the title itself announces as the live region.
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