added frontend
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
import 'http_client_factory_stub.dart' if (dart.library.io) 'http_client_factory_app.dart' if (dart.library.js) 'http_client_factory_web.dart';
|
||||
import 'http_client_interceptor.dart';
|
||||
|
||||
abstract class HttpClientUtils {
|
||||
http.Client get client;
|
||||
}
|
||||
|
||||
class HttpCLientUtilsImpl extends HttpClientUtils {
|
||||
http.Client? _client;
|
||||
|
||||
@override
|
||||
http.Client get client => _getClient();
|
||||
|
||||
http.Client _getClient() {
|
||||
_client ??= HttpClientInterceptor(getHttpClientFactory().createHttpClient());
|
||||
return _client!;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user