ServiceProviderUtils class

A utility class providing helper methods for handling HTTP responses, building JSON-RPC requests, and parsing responses in a service-oriented architecture.

Constructors

ServiceProviderUtils()

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

Static Methods

buildJsonRPCParams({required int requestId, required String method, Object? params}) Map<String, dynamic>
Builds a JSON-RPC request object.
findError({Object? object, required int statusCode}) String?
Finds an error message from the response based on the status code and object type.
findErrorDetails({Object? object, required int statusCode}) Map<String, dynamic>
Extracts detailed error information from the response.
isSuccessStatusCode(int statusCode) bool
Checks if the given HTTP status code indicates a successful response.
parseResponse<T>({required Object? object, required BaseServiceRequestParams params}) → T
Parses a response object into a result of type T.
toResult<T>(List<int> bytes) → T
Converts a list of bytes into a result of type T.