feat(todo): the calendars linked to projects fetched by the device and kept for offline (ADR 0033, D39)
`CalendarCubit` follows the projects' calendar links: a calendar linked is shown at once from the copy kept and fetched by the device over HTTPS (`HttpCalendarFeeds`, `webcal://` as HTTPS), as the app opens, every hour while it is open and when a list is pulled down; a fetch that fails, or answers with something that is no calendar, keeps the last copy; a link taken off, or its project gone, takes its events and its copy along. The copies are files in the person's own folder (`calendars/<project>.ics`). Nothing shows the events yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
892a58f4fd
commit
63d50f77d4
1 changed files with 475 additions and 7 deletions
|
|
@ -0,0 +1,14 @@
|
|||
import 'package:halkyon_todo_flutter/src/feature/calendar/data/calendar_feeds.dart';
|
||||
|
||||
/// Serves the calendar files [served] by their address, as a feed's host
|
||||
/// would, and remembers each address fetched; one it doesn't serve fails.
|
||||
class FakeCalendarFeeds() implements CalendarFeedGateway {
|
||||
final served = <Uri, String>{};
|
||||
final fetched = <Uri>[];
|
||||
|
||||
@override
|
||||
Future<String> fetch(Uri url) async {
|
||||
fetched.add(url);
|
||||
return served[url] ?? (throw CalendarFeedFailed('$url not served'));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue