prepare history api

This commit is contained in:
Fabian Freund
2025-09-17 17:53:06 +02:00
parent d24d612635
commit 9676ccae3d
10 changed files with 850 additions and 209 deletions
@@ -0,0 +1,27 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import 'package:flutter_mozilla_components/src/pigeons/gecko.g.dart';
final _apiInstance = GeckoHistoryApi();
class GeckoHistoryService {
final GeckoHistoryApi _api;
GeckoHistoryService({GeckoHistoryApi? api}) : _api = api ?? _apiInstance;
Future<List<VisitInfo>> getDetailedVisits(
DateTime start,
DateTime end,
Set<VisitType> types,
) {
return _api.getDetailedVisits(
start.millisecondsSinceEpoch,
end.millisecondsSinceEpoch,
VisitType.values.toSet().difference(types).toList(),
);
}
}