AIState<T> class

AI operation state model for Flutter

Constructors

AIState({T? data, bool loading = false, Exception? error, AIStatus status = AIStatus.idle, int progress = 0, CostSummary? cost, bool budgetExceeded = false})
Creates an AIState instance
const
AIState.error(Exception error)
Creates an error state
factory
AIState.idle()
Creates an idle state
factory
AIState.loading()
Creates a loading state
factory
AIState.success(T data, {CostSummary? cost})
Creates a success state
factory

Properties

budgetExceeded → bool
Whether budget is exceeded
final
cost → CostSummary?
Cost summary
final
data → T?
Current data from operation
final
error → Exception?
Error from operation
final
hashCode → int
The hash code for this object.
no setterinherited
loading → bool
Whether operation is in progress
final
progress → int
Progress percentage (0-100)
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
status → AIStatus
Current status
final

Methods

copyWith({T? data, bool? loading, Exception? error, AIStatus? status, int? progress, CostSummary? cost, bool? budgetExceeded}) → AIState<T>
Creates a copy with optional overrides
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