1
0
forked from firka/firka

ref: kreta_client

This commit is contained in:
checkedear
2026-05-17 19:40:49 +02:00
parent e8f1f18725
commit a61a41e677
6 changed files with 243 additions and 543 deletions

View File

@@ -1,17 +1,28 @@
class ApiResponse<T> {
T? response;
int statusCode;
String? err;
Object? err;
bool cached;
ApiResponse(this.response, this.statusCode, this.err, this.cached);
ApiResponse.fail(this.err) : response = null, statusCode = 0, cached = false;
ApiResponse.success(this.response, this.statusCode)
: err = null,
cached = false;
ApiResponse.cached(this.response)
: statusCode = 200,
err = null,
cached = true;
@override
String toString() {
return "ApiResponse("
"response: $response, "
"statusCode: $statusCode, "
"err: \"$err\", "
"err: \"${err.toString()}\", "
"cached: $cached"
")";
}