1- import 'enums.dart';
21import 'client_stub.dart'
32 if (dart.library.html) 'client_browser.dart'
43 if (dart.library.io) 'client_io.dart';
4+ import 'enums.dart';
55import 'response.dart';
66import 'upload_progress.dart';
77
88abstract class Client {
9- static const int CHUNK_SIZE = 5* 1024* 1024;
9+ static const int CHUNK_SIZE = 5 * 1024 * 1024;
1010 late Map<String , String > config;
1111 late String _endPoint;
1212 late String? _endPointRealtime;
1313
1414 String get endPoint => _endPoint;
1515 String? get endPointRealtime => _endPointRealtime;
1616
17- factory Client(
18- {String endPoint = '{{ spec .endpoint }}',
19- bool selfSigned = false}) =>
17+ factory Client({
18+ String endPoint = '{{ spec .endpoint }}',
19+ bool selfSigned = false,
20+ }) =>
2021 createClient(endPoint: endPoint, selfSigned: selfSigned);
2122
2223 Future webAuth(Uri url, {String? callbackUrlScheme});
@@ -38,17 +39,34 @@ abstract class Client {
3839
3940{% for header in spec .global .headers %}
4041{% if header .description %}
41- /// {{header .description }}
42+ /// {{header .description }}
4243{% endif %}
4344 Client set{{header .key | caseUcfirst }}(value);
4445{% endfor %}
4546
4647 Client addHeader(String key, String value);
4748
48- Future<Response > call(HttpMethod method, {
49+ Future<Response > call(
50+ HttpMethod method, {
4951 String path = '',
5052 Map<String , String > headers = const {},
5153 Map<String , dynamic > params = const {},
5254 ResponseType? responseType,
55+ String cacheModel = '',
56+ String cacheKey = '',
57+ String cacheResponseIdKey = '',
58+ String cacheResponseContainerKey = '',
59+ Map<String , Object ?>? previous,
60+ });
61+
62+ Future<Client > setOfflinePersistency({
63+ bool status = true,
64+ void Function(Object)? onWriteQueueError,
5365 });
66+
67+ bool getOfflinePersistency();
68+
69+ Client setOfflineCacheSize(int kbytes);
70+
71+ int getOfflineCacheSize();
5472}
0 commit comments