feat: recipe like

This commit is contained in:
BLoC
2025-01-24 14:34:55 +03:00
parent 394e6d8bbf
commit ae7c72cd53
19 changed files with 1117 additions and 1504 deletions

View File

@@ -9,11 +9,7 @@ part of 'ws_service.dart';
// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations
class _WsService implements WsService {
_WsService(
this._dio, {
this.baseUrl,
this.errorLogger,
});
_WsService(this._dio, {this.baseUrl, this.errorLogger});
final Dio _dio;
@@ -27,22 +23,16 @@ class _WsService implements WsService {
final queryParameters = <String, dynamic>{};
final _headers = <String, dynamic>{};
const Map<String, dynamic>? _data = null;
final _options = _setStreamType<WebsocketInfoModel>(Options(
method: 'GET',
headers: _headers,
extra: _extra,
)
.compose(
_dio.options,
'/api/profile/ws/params',
queryParameters: queryParameters,
data: _data,
)
.copyWith(
baseUrl: _combineBaseUrls(
_dio.options.baseUrl,
baseUrl,
)));
final _options = _setStreamType<WebsocketInfoModel>(
Options(method: 'GET', headers: _headers, extra: _extra)
.compose(
_dio.options,
'/api/profile/ws/params',
queryParameters: queryParameters,
data: _data,
)
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
);
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
late WebsocketInfoModel _value;
try {
@@ -67,10 +57,7 @@ class _WsService implements WsService {
return requestOptions;
}
String _combineBaseUrls(
String dioBaseUrl,
String? baseUrl,
) {
String _combineBaseUrls(String dioBaseUrl, String? baseUrl) {
if (baseUrl == null || baseUrl.trim().isEmpty) {
return dioBaseUrl;
}