Response<T extends Object> class
A generic response wrapper class that encapsulates API responses with status, data, and metadata information.
Type parameter T must be a non-nullable Object type.
- Inheritance
-
- Object
- DeepCollectionEquality
- Response
Constructors
-
Response({int requestCode = 0, double? progress, Status? status, String? error, String? message, Object? feedback, Object? snapshot, int? count, T? data, List<
T> ? backups, List<T> ? ignores, List<T> ? result, List<T> ? resultByMe, List<String> ? selections, Map<String, bool> ? exists}) - Response.failure(Object? error)
-
Creates a failure response with an error
factory
-
Response.ok({int? count, T? data, List<
T> ? result, List<T> ? resultByMe, List<String> ? selections, Map<String, bool> ? exists, String? message, Object? feedback, Object? snapshot}) -
Creates a successful response with optional data and metadata
factory
Properties
-
backups
→ List<
T> -
no setter
- count → int
-
no setter
- data → T?
-
no setter
- error → String
-
no setter
-
exists
→ Map<
String, bool> -
no setter
- feedback → Object?
-
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
-
ignores
→ List<
T> -
no setter
- isAvailable → bool
-
no setter
- isBackup → bool
-
no setter
- isCancel → bool
-
no setter
- isComplete → bool
-
no setter
- isError → bool
-
no setter
- isExistByMe → bool
-
no setter
- isFailed → bool
-
no setter
- isIgnored → bool
-
no setter
- isInternetError → bool
-
no setter
- isLoaded → bool
-
no setter
- isLoading → bool
-
no setter
- isMessage → bool
-
no setter
- isNullable → bool
-
no setter
- isPaused → bool
-
no setter
- isStopped → bool
-
no setter
- isSuccessful → bool
-
no setter
- isTimeout → bool
-
no setter
- isValid → bool
-
no setter
- message → String
-
no setter
- page → int
-
no setter
- progress → double
-
no setter
- requestCode → int
-
final
-
result
→ List<
T> -
no setter
-
resultByMe
→ List<
T> -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
selections
→ List<
String> -
no setter
- snapshot → Object?
-
no setter
- status → Status
-
no setter
Methods
-
copyWith(
{double? progress, Status? status, String? error, String? message, dynamic feedback, dynamic snapshot, int? count, int? requestCode, T? data, List< T> ? backups, List<T> ? ignores, List<T> ? result, List<T> ? resultByMe, List<String> ? selections, Map<String, bool> ? exists}) → Response<T> - Creates a copy of this Response with the given fields replaced
-
equals(
Object? e1, Object? e2) → bool -
Compare two elements for being equal.
inherited
-
hash(
Object? o) → int -
Creates a combined hash code for a number of objects.
inherited
-
isContain(
String id) → bool -
Checks if the given
idexists in selections -
isExist(
String id, [bool defaultValue = false]) → bool -
Checks if the given
idexists in the exists map -
isValidKey(
Object? o) → bool -
Test whether an object is a valid argument to equals and hash.
inherited
-
modifyWith(
{double? progress, Status? status, String? exception, String? message, dynamic feedback, dynamic snapshot, int? count, int? requestCode, T? data, List< T> ? backups, List<T> ? ignores, List<T> ? result, List<T> ? resultByMe, List<String> ? selections, Map<String, bool> ? exists}) → Response<T> - Modifies this Response in-place with the given fields
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notEquals(
dynamic e1, dynamic e2) → bool -
Compare two elements for being not equal.
inherited
-
snapshotAs<
Snapshot> () → Snapshot? -
Gets the snapshot cast to the specified type
Snapshot -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override