SonicResponse<T> class
Methods
-
nextCursor(Sonic sonic, {required String cursorPath, String param = 'cursor', HttpMethod method = HttpMethod.get})
→ SonicRequestBuilder<T>?
-
Cursor helpers for common JSON body styles.
Provide the cursor path (e.g., 'meta.nextCursor') and the query param name (e.g., 'cursor').
-
nextPage(Sonic sonic, {HttpMethod method = HttpMethod.get})
→ SonicRequestBuilder<T>?
-
Build a new request builder for the next page using Link headers (if any).
Requires providing a Sonic instance to construct the builder.
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
on<Y>(Y onData(T? data), Y onError(SonicError? error))
→ Y
-
An easier syntax than writting if conditions to return instances based on response.
-
prevCursor(Sonic sonic, {required String cursorPath, String param = 'cursor', HttpMethod method = HttpMethod.get})
→ SonicRequestBuilder<T>?
-
-
prevPage(Sonic sonic, {HttpMethod method = HttpMethod.get})
→ SonicRequestBuilder<T>?
-
Build a new request builder for the previous page using Link headers.
-
to<Y>(Y callback(SonicResponse<T> data))
→ Y
-
Transforms this instance of SonicResponse to
Y type with callback
-
toPaged({required T itemDecoder(dynamic json), String? itemsPath, String? nextCursorPath, String? prevCursorPath, String cursorParam = 'cursor'})
→ Paged<T>
-
Build a Paged
-
toString()
→ String
-
A string representation of this object.
inherited