PrismViewState<T> class sealed

A sealed view-state that drives PrismStateView rendering.

Dart 3 exhaustive switching means the compiler forces you to handle every state — no more forgotten error branches:

final state = switch (fetch()) {
  PrismViewLoading() => const CircularProgressIndicator(),
  PrismViewError(:final error) => Text('Failed: $error'),
  PrismViewEmpty() => const Text('Nothing here yet'),
  PrismViewSuccess(:final data) => Text(data),
};
Implementers

Constructors

PrismViewState.empty()
The operation succeeded but produced no data (e.g. an empty list).
const
factory
PrismViewState.error([Object? error, StackTrace? stackTrace])
Something went wrong. Carries the error and optional stackTrace.
const
factory
PrismViewState.loading({String? message})
Something is in progress.
const
factory
PrismViewState.success(T data)
The operation succeeded and produced data.
const
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited