nc-photos/app/lib/entity/face.dart

42 lines
818 B
Dart
Raw Normal View History

2021-09-10 19:10:26 +02:00
import 'package:equatable/equatable.dart';
import 'package:nc_photos/account.dart';
import 'package:nc_photos/entity/person.dart';
2022-12-08 16:39:13 +01:00
import 'package:to_string/to_string.dart';
2021-09-10 19:10:26 +02:00
2022-12-08 16:39:13 +01:00
part 'face.g.dart';
@toString
2021-09-10 19:10:26 +02:00
class Face with EquatableMixin {
2022-01-22 14:34:00 +01:00
const Face({
2021-09-10 19:10:26 +02:00
required this.id,
required this.fileId,
});
@override
2022-12-08 16:39:13 +01:00
String toString() => _$toString();
2021-09-10 19:10:26 +02:00
@override
get props => [
id,
fileId,
];
final int id;
final int fileId;
}
class FaceRepo {
const FaceRepo(this.dataSrc);
/// See [FaceDataSource.list]
Future<List<Face>> list(Account account, Person person) =>
2021-09-15 08:58:06 +02:00
dataSrc.list(account, person);
2021-09-10 19:10:26 +02:00
final FaceDataSource dataSrc;
}
abstract class FaceDataSource {
/// List all faces associated to [person]
Future<List<Face>> list(Account account, Person person);
}