import 'package:flutter/foundation.dart'; import 'package:nc_photos/entity/collection.dart'; import 'package:nc_photos/entity/collection/adapter.dart'; import 'package:nc_photos/entity/collection_item.dart'; import 'package:nc_photos/entity/collection_item/util.dart'; import 'package:nc_photos/entity/file_descriptor.dart'; import 'package:nc_photos/or_null.dart'; import 'package:np_common/type.dart'; /// A read-only collection that does not support modifying its items mixin CollectionReadOnlyAdapter implements CollectionAdapter { @override Future addFiles( List files, { ErrorWithValueHandler? onError, required ValueChanged onCollectionUpdated, }) { throw UnsupportedError("Operation not supported"); } @override Future edit({ String? name, List? items, CollectionItemSort? itemSort, OrNull? cover, List? knownItems, }) { throw UnsupportedError("Operation not supported"); } @override Future removeItems( List items, { ErrorWithValueIndexedHandler? onError, required ValueChanged onCollectionUpdated, }) { throw UnsupportedError("Operation not supported"); } @override bool isItemRemovable(CollectionItem item) => false; @override bool isManualCover() => false; @override Future updatePostLoad(List items) => Future.value(null); }