RAutocompleteRemoteState class final

Current state of the remote source.

Passed to renderer via request features so slots can display appropriate UI (loading indicator, error message, retry button, etc.).

Example usage in a slot:

final remoteState = ctx.features.get(rAutocompleteRemoteStateKey);
if (remoteState?.isLoading == true) {
  return CircularProgressIndicator();
}
if (remoteState?.isError == true) {
  return Column(
    children: [
      Text(remoteState.error?.message ?? 'Error'),
      TextButton(onPressed: onRetry, child: Text('Retry')),
    ],
  );
}
Annotations

Constructors

RAutocompleteRemoteState({required RAutocompleteRemoteStatus status, String queryText = '', RAutocompleteRemoteError? error, bool isStale = false, bool canRetry = false})
Creates a remote state with the given parameters.
const

Properties

canRetry bool
Whether retry is available (only meaningful when status is error).
final
error RAutocompleteRemoteError?
Error information if status is RAutocompleteRemoteStatus.error.
final
hashCode int
The hash code for this object.
no setteroverride
isError bool
Whether the remote source has an error.
no setter
isIdle bool
Whether the remote source is idle (not started or below minQueryLength).
no setter
isLoading bool
Whether the remote source is currently loading.
no setter
isReady bool
Whether the remote source has successfully loaded results.
no setter
isStale bool
Whether the current results are stale (from a previous query).
final
queryText String
The query text that was used for the current/last load.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status RAutocompleteRemoteStatus
Current status of the remote source.
final

Methods

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

Operators

operator ==(Object other) bool
The equality operator.
override

Constants

idle → const RAutocompleteRemoteState
Idle state constant (no remote load yet).