mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-23 17:26:18 +01:00
24 lines
828 B
Dart
24 lines
828 B
Dart
|
import 'package:nc_photos/account.dart';
|
||
|
import 'package:nc_photos/di_container.dart';
|
||
|
import 'package:nc_photos/entity/person.dart';
|
||
|
import 'package:nc_photos/entity/person/adapter/face_recognition.dart';
|
||
|
import 'package:nc_photos/entity/person/content_provider/face_recognition.dart';
|
||
|
import 'package:nc_photos/entity/person_face.dart';
|
||
|
|
||
|
abstract class PersonAdapter {
|
||
|
const PersonAdapter();
|
||
|
|
||
|
static PersonAdapter of(DiContainer c, Account account, Person person) {
|
||
|
switch (person.contentProvider.runtimeType) {
|
||
|
case PersonFaceRecognitionProvider:
|
||
|
return PersonFaceRecognitionAdapter(c, account, person);
|
||
|
default:
|
||
|
throw UnsupportedError(
|
||
|
"Unknown type: ${person.contentProvider.runtimeType}");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/// List faces of this person
|
||
|
Stream<List<PersonFace>> listFace();
|
||
|
}
|