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/util.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/entity/sharee.dart'; import 'package:np_common/or_null.dart'; import 'package:np_common/type.dart'; import 'package:np_string/np_string.dart'; /// A read-only collection that does not support modifying its items mixin CollectionAdapterReadOnlyTag 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); } mixin CollectionAdapterUnremovableTag implements CollectionAdapter { @override Future remove() { throw UnsupportedError("Operation not supported"); } } mixin CollectionAdapterUnshareableTag implements CollectionAdapter { @override Future share( Sharee sharee, { required ValueChanged onCollectionUpdated, }) { throw UnsupportedError("Operation not supported"); } @override Future unshare( CiString userId, { required ValueChanged onCollectionUpdated, }) { throw UnsupportedError("Operation not supported"); } @override Future importPendingShared() { throw UnsupportedError("Operation not supported"); } }