save method

  1. @override
Future<void> save(
  1. FaceTemplate template
)
override

Save or update a template.

Implementation

@override
Future<void> save(FaceTemplate template) async {
  final json = jsonEncode(template.toJson());
  await _storage.write(key: _templateKey(template.id), value: json);

  final index = await _readIndex();
  if (index.add(template.id)) {
    await _writeIndex(index);
  }
}