mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-23 17:26:18 +01:00
50 lines
1.5 KiB
Dart
50 lines
1.5 KiB
Dart
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<int> addFiles(
|
|
List<FileDescriptor> files, {
|
|
ErrorWithValueHandler<FileDescriptor>? onError,
|
|
required ValueChanged<Collection> onCollectionUpdated,
|
|
}) {
|
|
throw UnsupportedError("Operation not supported");
|
|
}
|
|
|
|
@override
|
|
Future<Collection> edit({
|
|
String? name,
|
|
List<CollectionItem>? items,
|
|
CollectionItemSort? itemSort,
|
|
OrNull<FileDescriptor>? cover,
|
|
List<CollectionItem>? knownItems,
|
|
}) {
|
|
throw UnsupportedError("Operation not supported");
|
|
}
|
|
|
|
@override
|
|
Future<int> removeItems(
|
|
List<CollectionItem> items, {
|
|
ErrorWithValueIndexedHandler<CollectionItem>? onError,
|
|
required ValueChanged<Collection> onCollectionUpdated,
|
|
}) {
|
|
throw UnsupportedError("Operation not supported");
|
|
}
|
|
|
|
@override
|
|
bool isItemRemovable(CollectionItem item) => false;
|
|
|
|
@override
|
|
bool isManualCover() => false;
|
|
|
|
@override
|
|
Future<Collection?> updatePostLoad(List<CollectionItem> items) =>
|
|
Future.value(null);
|
|
}
|