mirror of
https://github.com/immich-app/immich.git
synced 2024-12-23 02:06:15 +02:00
21 lines
585 B
Dart
21 lines
585 B
Dart
|
import 'dart:convert';
|
||
|
|
||
|
import 'package:flutter/material.dart';
|
||
|
import 'package:immich_mobile/shared/services/network.service.dart';
|
||
|
|
||
|
class SearchService {
|
||
|
final NetworkService _networkService = NetworkService();
|
||
|
|
||
|
Future<List<String>?> getUserSuggestedSearchTerms() async {
|
||
|
try {
|
||
|
var res = await _networkService.getRequest(url: "asset/searchTerm");
|
||
|
List<dynamic> decodedData = jsonDecode(res.toString());
|
||
|
|
||
|
return List.from(decodedData);
|
||
|
} catch (e) {
|
||
|
debugPrint("[ERROR] [getUserSuggestedSearchTerms] ${e.toString()}");
|
||
|
return [];
|
||
|
}
|
||
|
}
|
||
|
}
|