SocketResponse<T> class
Standard response from socket server
Constructors
- SocketResponse({required String status, T? data, String? error})
-
const
-
SocketResponse.fromJson(Map<
String, dynamic> json, T fromJsonT(Object?)) -
factory
-
SocketResponse.fromJsonSimple(Map<
String, dynamic> json) -
Convenience factory for simple responses without data transformation
factory
Properties
- data → T?
-
final
- error → String?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isError → bool
-
Check if the response is an error
no setter
- isSuccess → bool
-
Check if the response is successful
no setter
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → String
-
final
- stringify → bool?
-
If set to
true, thetoStringmethod will be overridden to output this instance'sprops.no setterinherited
Methods
-
copyWith(
{String? status, T? data, String? error}) → SocketResponse< T> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
Object? toJsonT(T)?) → Map< String, dynamic> -
toString(
) → String - A string representation of this object.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited