intermediate

This commit is contained in:
Fabian Freund
2024-12-12 09:44:33 +01:00
parent 0710116feb
commit 6b2ae28828
108 changed files with 5531 additions and 2265 deletions
@@ -3,12 +3,14 @@ import 'dart:convert';
import 'package:exceptions/exceptions.dart';
import 'package:http/http.dart' as http;
import 'package:lensai/core/http_error_handler.dart';
import 'package:lensai/features/search/domain/entities/abstract/i_search_suggestion_provider.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
part 'autosuggest.g.dart';
@Riverpod(keepAlive: true)
class KagiAutosuggestService extends _$KagiAutosuggestService {
class KagiAutosuggestService extends _$KagiAutosuggestService
implements ISearchSuggestionProvider {
static final _baseUrl = Uri.https('kagi.com', 'api/autosuggest');
late http.Client _client;
@@ -18,6 +20,7 @@ class KagiAutosuggestService extends _$KagiAutosuggestService {
_client = http.Client();
}
@override
Future<Result<List<String>>> getSuggestions(String query) async {
return Result.fromAsync(
() async {
@@ -7,7 +7,7 @@ part of 'autosuggest.dart';
// **************************************************************************
String _$kagiAutosuggestServiceHash() =>
r'843b0d84b1dde2d903412a123c8c10d26e8036fd';
r'e1cb4ef730bcf5c4bf4c77617bb12a22228af576';
/// See also [KagiAutosuggestService].
@ProviderFor(KagiAutosuggestService)