2021-08-08 04:34:44 +08:00
|
|
|
import 'package:nc_photos/account.dart';
|
2021-12-04 01:31:27 +08:00
|
|
|
import 'package:nc_photos/di_container.dart';
|
2021-08-08 04:34:44 +08:00
|
|
|
import 'package:nc_photos/entity/file.dart';
|
|
|
|
import 'package:nc_photos/entity/share.dart';
|
|
|
|
|
|
|
|
/// List all shares from a given file
|
|
|
|
class ListShare {
|
2021-12-04 01:31:27 +08:00
|
|
|
ListShare(this._c) : assert(require(_c));
|
|
|
|
|
|
|
|
static bool require(DiContainer c) => DiContainer.has(c, DiType.shareRepo);
|
2021-08-08 04:34:44 +08:00
|
|
|
|
|
|
|
Future<List<Share>> call(Account account, File file) =>
|
2021-12-04 01:31:27 +08:00
|
|
|
_c.shareRepo.list(account, file);
|
2021-08-08 04:34:44 +08:00
|
|
|
|
2021-12-04 01:31:27 +08:00
|
|
|
final DiContainer _c;
|
2021-08-08 04:34:44 +08:00
|
|
|
}
|