Files
localsend/app/lib/provider/http_provider.dart
T
Tien Do Nam 90de693a9b
CI / format (push) Has been cancelled
CI / test (push) Has been cancelled
CI / packaging (push) Has been cancelled
feat: integrate rust http client
2026-03-03 02:34:20 +01:00

20 lines
602 B
Dart

import 'package:localsend_app/provider/security_provider.dart';
import 'package:localsend_app/rust/api/http.dart';
import 'package:refena_flutter/refena_flutter.dart';
class HttpClientCollection {
final RsHttpClient v2;
HttpClientCollection({
required this.v2,
});
}
/// Provides an HTTP client for each protocol version.
final httpProvider = ViewProvider((ref) {
final securityContext = ref.watch(securityProvider);
return HttpClientCollection(
v2: createClient(privateKey: securityContext.privateKey, cert: securityContext.certificate, version: LsHttpClientVersion.v2),
);
});