PrismSyncStatus class

A compact, always-on-screen indicator of sync state.

Pairs with any sync engine that can produce a PrismSyncSnapshot. With flutter_local_first that is one ValueListenableBuilder and the adapter shown on PrismSyncPhase:

ValueListenableBuilder(
  valueListenable: syncEngine.state,
  builder: (context, state, _) =>
      PrismSyncStatus(snapshot: snapshotOf(state)),
)

It is a live region, so a screen reader hears a sync fail without the user having to hunt for it, and it collapses to a single icon when idle so it does not add noise to a toolbar.

Inheritance

Constructors

PrismSyncStatus({Key? key, required PrismSyncSnapshot snapshot, bool showLabel = true, VoidCallback? onRetry, String retryLabel = 'Retry', bool compact = false})
Creates a sync status indicator.
const

Properties

compact → bool
Renders an icon-only chip with a smaller footprint.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onRetry → VoidCallback?
Called when retry is tapped. A retry action is only offered with a failure.
final
retryLabel → String
Label for the retry action.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showLabel → bool
Whether to show the text label beside the icon. When false, the label is still announced to assistive tech.
final
snapshot → PrismSyncSnapshot
The current state.
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