feat: start working on sell

This commit is contained in:
alzalia1 2025-08-14 13:42:20 +02:00
parent f378c8c0be
commit 1803a2b119
8 changed files with 94 additions and 31 deletions

View file

@ -16,6 +16,22 @@ class OwnerRepository {
final WebsocketClient _wsClient;
late final StreamSubscription sub;
List<Owner>? _cachedOwners;
Owner? _sectionOwner;
Future<Result<Owner>> get sectionOwner async {
if (_sectionOwner != null) {
return Result.ok(_sectionOwner!);
}
final result = await _apiClient.getSectionOwner();
switch (result) {
case Ok():
_sectionOwner = result.value;
break;
default:
break;
}
return result;
}
/// Adds an [Owner] to the database, and gets the resulting [Owner].
Future<Result<Owner>> addOwner(