SyncApiClient class abstract

Клиент для загрузки сохранённых данных и обновления из сети.

Без onSync запрос идёт только в сеть и не обращается к кешу.

Передайте SyncApiRequestScope для группы связанных запросов. Без scope get группирует по методу и пути, batch не группируется.

Inheritance

Constructors

SyncApiClient({List<Interceptor> interceptors = const [], Duration timeout = const Duration(seconds: 15)})

Properties

getAccessToken → String?
no setterinherited
getAuthStatusStream → Stream<AuthStatusEnum>
no setterinherited
getUserId → String?
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

batch<T>(String path, {required PaginationModel pagination, Map<String, dynamic>? queryParameters, Options? options, RequestEnum type = .get, List<JsonFieldAliasModel> jsonSchemas = const [], required dynamic mapper(dynamic json), void onAsync(Either<BaseException, T> result)?, void onSync(Either<BaseException, T> result)?, SyncApiRequestScope? scope}) → Future<Either<BaseException, T>>
override
delete<T>(String path, {dynamic body, Map<String, dynamic>? queryParameters, required T mapper(dynamic json)}) → Future<Either<BaseException, T>>
inherited
download<T>(String path, {Map<String, dynamic>? params, VoidDataFunction<double>? onProgress, RequestEnum type = .get, required Future<T> saver(Uint8List bytes)}) → Future<Either<BaseException, T>>
inherited
get<T>(String path, {Map<String, dynamic>? queryParameters, required dynamic mapper(dynamic json), Options? options, VoidDataFunction<double>? onProgress, List<JsonFieldAliasModel> jsonSchemas = const [], RequestEnum type = .get, void onAsync(Either<BaseException, T> result)?, void onSync(Either<BaseException, T> result)?, SyncApiRequestScope? scope}) → Future<Either<BaseException, T>>
override
initTokenManager({required RepeatRequestUserCase repeatRequest, required RefreshTokenRequestUserCase refreshTokenRequest, required dynamic getTokenInterseptor(InterceptorsWrapper interseptor)}) → void
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
patch<T>(String path, {dynamic body, required T mapper(dynamic json)}) → Future<Either<BaseException, T>>
inherited
post<T>(String path, {dynamic body, Options? options, required T mapper(dynamic json)}) → Future<Either<BaseException, T>>
inherited
put<T>(String path, {dynamic body, required T mapper(dynamic json)}) → Future<Either<BaseException, T>>
inherited
toString() → String
A string representation of this object.
inherited
upload<T>(String path, {required List<File> files, required T mapper(dynamic json)}) → Future<Either<BaseException, T>>
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited