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

43 lines
825 B
Dart
Raw Normal View History

import 'package:equatable/equatable.dart';
import 'package:nc_photos/account.dart';
2022-12-08 16:39:13 +01:00
import 'package:to_string/to_string.dart';
2022-12-08 16:39:13 +01:00
part 'person.g.dart';
@toString
class Person with EquatableMixin {
2022-08-05 11:14:03 +02:00
const Person({
2021-09-10 19:10:26 +02:00
required this.name,
required this.thumbFaceId,
required this.count,
});
2021-09-10 19:10:26 +02:00
@override
2022-12-08 16:39:13 +01:00
String toString() => _$toString();
2021-09-10 19:10:26 +02:00
@override
get props => [
name,
2021-09-10 19:10:26 +02:00
thumbFaceId,
count,
];
2021-09-10 19:10:26 +02:00
final String name;
final int thumbFaceId;
final int count;
}
class PersonRepo {
const PersonRepo(this.dataSrc);
/// See [PersonDataSource.list]
2021-09-15 08:58:06 +02:00
Future<List<Person>> list(Account account) => dataSrc.list(account);
final PersonDataSource dataSrc;
}
abstract class PersonDataSource {
/// List all people for this account
Future<List<Person>> list(Account account);
}