intermediate
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user