Skip to content

armgit / ente

Public Imported from GitHub
0

💚 End-to-end encrypted cloud for everything.

[mob][photos] Initial settings screen for face recognition

laurensprieme414128f18b9
diff --git a/auth/assets/simple-icons b/auth/assets/simple-icons
index 8a3731352a..8e7701d6a4 160000
--- a/auth/assets/simple-icons
+++ b/auth/assets/simple-icons
@@ -1 +1 @@
-Subproject commit 8a3731352af133a02223a6c7b1f37c4abb096af0
+Subproject commit 8e7701d6a40462733043f54b3849faf35af70a83
diff --git a/mobile/lib/generated/intl/messages_cs.dart b/mobile/lib/generated/intl/messages_cs.dart
index 315c67d33a..6569d740aa 100644
--- a/mobile/lib/generated/intl/messages_cs.dart
+++ b/mobile/lib/generated/intl/messages_cs.dart
@@ -46,6 +46,10 @@ class MessageLookup extends MessageLookupByLibrary {
"Edits to location will only be seen within Ente"),
"enterPersonName":
MessageLookupByLibrary.simpleMessage("Enter person name"),
+ "faceRecognition":
+ MessageLookupByLibrary.simpleMessage("Face recognition"),
+ "faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
+ "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
"fileTypes": MessageLookupByLibrary.simpleMessage("File types"),
"joinDiscord": MessageLookupByLibrary.simpleMessage("Join Discord"),
"locations": MessageLookupByLibrary.simpleMessage("Locations"),
diff --git a/mobile/lib/generated/intl/messages_de.dart b/mobile/lib/generated/intl/messages_de.dart
index 88e2852a68..37b9d48d46 100644
--- a/mobile/lib/generated/intl/messages_de.dart
+++ b/mobile/lib/generated/intl/messages_de.dart
@@ -702,6 +702,10 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Protokolle exportieren"),
"exportYourData":
MessageLookupByLibrary.simpleMessage("Daten exportieren"),
+ "faceRecognition":
+ MessageLookupByLibrary.simpleMessage("Face recognition"),
+ "faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
+ "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
"faces": MessageLookupByLibrary.simpleMessage("Gesichter"),
"failedToApplyCode": MessageLookupByLibrary.simpleMessage(
"Der Code konnte nicht aktiviert werden"),
diff --git a/mobile/lib/generated/intl/messages_en.dart b/mobile/lib/generated/intl/messages_en.dart
index d74dbf15cf..1affa86fff 100644
--- a/mobile/lib/generated/intl/messages_en.dart
+++ b/mobile/lib/generated/intl/messages_en.dart
@@ -700,6 +700,10 @@ class MessageLookup extends MessageLookupByLibrary {
"exportLogs": MessageLookupByLibrary.simpleMessage("Export logs"),
"exportYourData":
MessageLookupByLibrary.simpleMessage("Export your data"),
+ "faceRecognition":
+ MessageLookupByLibrary.simpleMessage("Face recognition"),
+ "faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
+ "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
"faces": MessageLookupByLibrary.simpleMessage("Faces"),
"failedToApplyCode":
MessageLookupByLibrary.simpleMessage("Failed to apply code"),
diff --git a/mobile/lib/generated/intl/messages_es.dart b/mobile/lib/generated/intl/messages_es.dart
index 88ef5b2443..8393b37677 100644
--- a/mobile/lib/generated/intl/messages_es.dart
+++ b/mobile/lib/generated/intl/messages_es.dart
@@ -611,6 +611,10 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Exportar registros"),
"exportYourData":
MessageLookupByLibrary.simpleMessage("Exportar tus datos"),
+ "faceRecognition":
+ MessageLookupByLibrary.simpleMessage("Face recognition"),
+ "faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
+ "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
"failedToApplyCode":
MessageLookupByLibrary.simpleMessage("Error al aplicar el código"),
"failedToCancel":
diff --git a/mobile/lib/generated/intl/messages_fr.dart b/mobile/lib/generated/intl/messages_fr.dart
index 7e9875c81c..eb1f63e2ad 100644
--- a/mobile/lib/generated/intl/messages_fr.dart
+++ b/mobile/lib/generated/intl/messages_fr.dart
@@ -690,6 +690,10 @@ class MessageLookup extends MessageLookupByLibrary {
"exportLogs": MessageLookupByLibrary.simpleMessage("Exporter les logs"),
"exportYourData":
MessageLookupByLibrary.simpleMessage("Exportez vos données"),
+ "faceRecognition":
+ MessageLookupByLibrary.simpleMessage("Face recognition"),
+ "faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
+ "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
"faces": MessageLookupByLibrary.simpleMessage("Visages"),
"failedToApplyCode": MessageLookupByLibrary.simpleMessage(
"Impossible d\'appliquer le code"),
diff --git a/mobile/lib/generated/intl/messages_it.dart b/mobile/lib/generated/intl/messages_it.dart
index 9cde66f877..9c9268de25 100644
--- a/mobile/lib/generated/intl/messages_it.dart
+++ b/mobile/lib/generated/intl/messages_it.dart
@@ -667,6 +667,10 @@ class MessageLookup extends MessageLookupByLibrary {
"Questo link è scaduto. Si prega di selezionare un nuovo orario di scadenza o disabilitare la scadenza del link."),
"exportLogs": MessageLookupByLibrary.simpleMessage("Esporta log"),
"exportYourData": MessageLookupByLibrary.simpleMessage("Esporta dati"),
+ "faceRecognition":
+ MessageLookupByLibrary.simpleMessage("Face recognition"),
+ "faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
+ "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
"failedToApplyCode": MessageLookupByLibrary.simpleMessage(
"Impossibile applicare il codice"),
"failedToCancel":
diff --git a/mobile/lib/generated/intl/messages_ko.dart b/mobile/lib/generated/intl/messages_ko.dart
index 9459978cd5..f5d5f81f9e 100644
--- a/mobile/lib/generated/intl/messages_ko.dart
+++ b/mobile/lib/generated/intl/messages_ko.dart
@@ -46,6 +46,10 @@ class MessageLookup extends MessageLookupByLibrary {
"Edits to location will only be seen within Ente"),
"enterPersonName":
MessageLookupByLibrary.simpleMessage("Enter person name"),
+ "faceRecognition":
+ MessageLookupByLibrary.simpleMessage("Face recognition"),
+ "faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
+ "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
"fileTypes": MessageLookupByLibrary.simpleMessage("File types"),
"joinDiscord": MessageLookupByLibrary.simpleMessage("Join Discord"),
"locations": MessageLookupByLibrary.simpleMessage("Locations"),
diff --git a/mobile/lib/generated/intl/messages_nl.dart b/mobile/lib/generated/intl/messages_nl.dart
index f6987973c3..63dacc5bce 100644
--- a/mobile/lib/generated/intl/messages_nl.dart
+++ b/mobile/lib/generated/intl/messages_nl.dart
@@ -723,6 +723,10 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Logboek exporteren"),
"exportYourData":
MessageLookupByLibrary.simpleMessage("Exporteer je gegevens"),
+ "faceRecognition":
+ MessageLookupByLibrary.simpleMessage("Face recognition"),
+ "faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
+ "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
"faces": MessageLookupByLibrary.simpleMessage("Gezichten"),
"failedToApplyCode":
MessageLookupByLibrary.simpleMessage("Code toepassen mislukt"),
diff --git a/mobile/lib/generated/intl/messages_no.dart b/mobile/lib/generated/intl/messages_no.dart
index 51a3895dfa..85de86c02c 100644
--- a/mobile/lib/generated/intl/messages_no.dart
+++ b/mobile/lib/generated/intl/messages_no.dart
@@ -63,6 +63,10 @@ class MessageLookup extends MessageLookupByLibrary {
"Vennligst skriv inn en gyldig e-postadresse."),
"enterYourEmailAddress": MessageLookupByLibrary.simpleMessage(
"Skriv inn e-postadressen din"),
+ "faceRecognition":
+ MessageLookupByLibrary.simpleMessage("Face recognition"),
+ "faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
+ "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
"feedback": MessageLookupByLibrary.simpleMessage("Tilbakemelding"),
"fileTypes": MessageLookupByLibrary.simpleMessage("File types"),
"invalidEmailAddress":
diff --git a/mobile/lib/generated/intl/messages_pl.dart b/mobile/lib/generated/intl/messages_pl.dart
index efc9e46102..f0442c03a3 100644
--- a/mobile/lib/generated/intl/messages_pl.dart
+++ b/mobile/lib/generated/intl/messages_pl.dart
@@ -111,6 +111,10 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("Wprowadź hasło"),
"enterYourRecoveryKey": MessageLookupByLibrary.simpleMessage(
"Wprowadź swój klucz odzyskiwania"),
+ "faceRecognition":
+ MessageLookupByLibrary.simpleMessage("Face recognition"),
+ "faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
+ "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
"feedback": MessageLookupByLibrary.simpleMessage("Informacja zwrotna"),
"fileTypes": MessageLookupByLibrary.simpleMessage("File types"),
"forgotPassword":
diff --git a/mobile/lib/generated/intl/messages_pt.dart b/mobile/lib/generated/intl/messages_pt.dart
index ef6dc5e54e..c9245323ba 100644
--- a/mobile/lib/generated/intl/messages_pt.dart
+++ b/mobile/lib/generated/intl/messages_pt.dart
@@ -713,6 +713,10 @@ class MessageLookup extends MessageLookupByLibrary {
"exportLogs": MessageLookupByLibrary.simpleMessage("Exportar logs"),
"exportYourData":
MessageLookupByLibrary.simpleMessage("Exportar seus dados"),
+ "faceRecognition":
+ MessageLookupByLibrary.simpleMessage("Face recognition"),
+ "faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
+ "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
"faces": MessageLookupByLibrary.simpleMessage("Rostos"),
"failedToApplyCode":
MessageLookupByLibrary.simpleMessage("Falha ao aplicar o código"),
diff --git a/mobile/lib/generated/intl/messages_zh.dart b/mobile/lib/generated/intl/messages_zh.dart
index 80cc135697..b82f595f90 100644
--- a/mobile/lib/generated/intl/messages_zh.dart
+++ b/mobile/lib/generated/intl/messages_zh.dart
@@ -592,6 +592,10 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("此链接已过期。请选择新的过期时间或禁用链接有效期。"),
"exportLogs": MessageLookupByLibrary.simpleMessage("导出日志"),
"exportYourData": MessageLookupByLibrary.simpleMessage("导出您的数据"),
+ "faceRecognition":
+ MessageLookupByLibrary.simpleMessage("Face recognition"),
+ "faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
+ "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
"faces": MessageLookupByLibrary.simpleMessage("人脸"),
"failedToApplyCode": MessageLookupByLibrary.simpleMessage("无法使用此代码"),
"failedToCancel": MessageLookupByLibrary.simpleMessage("取消失败"),
diff --git a/mobile/lib/generated/l10n.dart b/mobile/lib/generated/l10n.dart
index 58d7bed8ab..d7057d2fef 100644
--- a/mobile/lib/generated/l10n.dart
+++ b/mobile/lib/generated/l10n.dart
@@ -8753,6 +8753,26 @@ class S {
args: [],
);
}
+
+ /// `Face recognition`
+ String get faceRecognition {
+ return Intl.message(
+ 'Face recognition',
+ name: 'faceRecognition',
+ desc: '',
+ args: [],
+ );
+ }
+
+ /// `Please note that this will result in a higher bandwidth and battery usage until all items are indexed.`
+ String get faceRecognitionIndexingDescription {
+ return Intl.message(
+ 'Please note that this will result in a higher bandwidth and battery usage until all items are indexed.',
+ name: 'faceRecognitionIndexingDescription',
+ desc: '',
+ args: [],
+ );
+ }
}
class AppLocalizationDelegate extends LocalizationsDelegate<S> {
diff --git a/mobile/lib/l10n/intl_cs.arb b/mobile/lib/l10n/intl_cs.arb
index 8730fe40ce..7aaa12b39b 100644
--- a/mobile/lib/l10n/intl_cs.arb
+++ b/mobile/lib/l10n/intl_cs.arb
@@ -20,5 +20,7 @@
"createCollaborativeLink": "Create collaborative link",
"search": "Search",
"enterPersonName": "Enter person name",
- "removePersonLabel": "Remove person label"
+ "removePersonLabel": "Remove person label",
+ "faceRecognition": "Face recognition",
+ "faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_de.arb b/mobile/lib/l10n/intl_de.arb
index 29e2eca5e8..d3d2b0337c 100644
--- a/mobile/lib/l10n/intl_de.arb
+++ b/mobile/lib/l10n/intl_de.arb
@@ -1208,5 +1208,7 @@
"createCollaborativeLink": "Create collaborative link",
"search": "Search",
"enterPersonName": "Enter person name",
- "removePersonLabel": "Remove person label"
+ "removePersonLabel": "Remove person label",
+ "faceRecognition": "Face recognition",
+ "faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_en.arb b/mobile/lib/l10n/intl_en.arb
index fd3387d774..12a7f59789 100644
--- a/mobile/lib/l10n/intl_en.arb
+++ b/mobile/lib/l10n/intl_en.arb
@@ -1231,5 +1231,7 @@
"castIPMismatchBody": "Please make sure you are on the same network as the TV.",
"pairingComplete": "Pairing complete",
"autoPair": "Auto pair",
- "pairWithPin": "Pair with PIN"
+ "pairWithPin": "Pair with PIN",
+ "faceRecognition": "Face recognition",
+ "faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_es.arb b/mobile/lib/l10n/intl_es.arb
index 0bfb398d55..7730a1f5eb 100644
--- a/mobile/lib/l10n/intl_es.arb
+++ b/mobile/lib/l10n/intl_es.arb
@@ -982,5 +982,7 @@
"createCollaborativeLink": "Create collaborative link",
"search": "Search",
"enterPersonName": "Enter person name",
- "removePersonLabel": "Remove person label"
+ "removePersonLabel": "Remove person label",
+ "faceRecognition": "Face recognition",
+ "faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_fr.arb b/mobile/lib/l10n/intl_fr.arb
index 0049fa7581..902032f2e5 100644
--- a/mobile/lib/l10n/intl_fr.arb
+++ b/mobile/lib/l10n/intl_fr.arb
@@ -1163,5 +1163,7 @@
"createCollaborativeLink": "Create collaborative link",
"search": "Search",
"enterPersonName": "Enter person name",
- "removePersonLabel": "Remove person label"
+ "removePersonLabel": "Remove person label",
+ "faceRecognition": "Face recognition",
+ "faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_it.arb b/mobile/lib/l10n/intl_it.arb
index 97d8059e8c..ad58b99a5d 100644
--- a/mobile/lib/l10n/intl_it.arb
+++ b/mobile/lib/l10n/intl_it.arb
@@ -1125,5 +1125,7 @@
"createCollaborativeLink": "Create collaborative link",
"search": "Search",
"enterPersonName": "Enter person name",
- "removePersonLabel": "Remove person label"
+ "removePersonLabel": "Remove person label",
+ "faceRecognition": "Face recognition",
+ "faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_ko.arb b/mobile/lib/l10n/intl_ko.arb
index 8730fe40ce..7aaa12b39b 100644
--- a/mobile/lib/l10n/intl_ko.arb
+++ b/mobile/lib/l10n/intl_ko.arb
@@ -20,5 +20,7 @@
"createCollaborativeLink": "Create collaborative link",
"search": "Search",
"enterPersonName": "Enter person name",
- "removePersonLabel": "Remove person label"
+ "removePersonLabel": "Remove person label",
+ "faceRecognition": "Face recognition",
+ "faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_nl.arb b/mobile/lib/l10n/intl_nl.arb
index a8f854a430..776adb704f 100644
--- a/mobile/lib/l10n/intl_nl.arb
+++ b/mobile/lib/l10n/intl_nl.arb
@@ -1226,5 +1226,7 @@
"stopCastingBody": "Wil je stoppen met casten?",
"castIPMismatchTitle": "Album casten mislukt",
"castIPMismatchBody": "Zorg ervoor dat je op hetzelfde netwerk zit als de tv.",
- "pairingComplete": "Koppeling voltooid"
+ "pairingComplete": "Koppeling voltooid",
+ "faceRecognition": "Face recognition",
+ "faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_no.arb b/mobile/lib/l10n/intl_no.arb
index 1d09ae2501..93ed10d701 100644
--- a/mobile/lib/l10n/intl_no.arb
+++ b/mobile/lib/l10n/intl_no.arb
@@ -34,5 +34,7 @@
"createCollaborativeLink": "Create collaborative link",
"search": "Search",
"enterPersonName": "Enter person name",
- "removePersonLabel": "Remove person label"
+ "removePersonLabel": "Remove person label",
+ "faceRecognition": "Face recognition",
+ "faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_pl.arb b/mobile/lib/l10n/intl_pl.arb
index 9b0c7270ff..6d92cb673a 100644
--- a/mobile/lib/l10n/intl_pl.arb
+++ b/mobile/lib/l10n/intl_pl.arb
@@ -121,5 +121,7 @@
"createCollaborativeLink": "Create collaborative link",
"search": "Search",
"enterPersonName": "Enter person name",
- "removePersonLabel": "Remove person label"
+ "removePersonLabel": "Remove person label",
+ "faceRecognition": "Face recognition",
+ "faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_pt.arb b/mobile/lib/l10n/intl_pt.arb
index 08d932cdaa..ebc823f392 100644
--- a/mobile/lib/l10n/intl_pt.arb
+++ b/mobile/lib/l10n/intl_pt.arb
@@ -1226,5 +1226,7 @@
"stopCastingBody": "Você quer parar a transmissão?",
"castIPMismatchTitle": "Falha ao transmitir álbum",
"castIPMismatchBody": "Certifique-se de estar na mesma rede que a TV.",
- "pairingComplete": "Pareamento concluído"
+ "pairingComplete": "Pareamento concluído",
+ "faceRecognition": "Face recognition",
+ "faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
}
\ No newline at end of file
diff --git a/mobile/lib/l10n/intl_zh.arb b/mobile/lib/l10n/intl_zh.arb
index 9a854a4f0f..55aa349acd 100644
--- a/mobile/lib/l10n/intl_zh.arb
+++ b/mobile/lib/l10n/intl_zh.arb
@@ -1226,5 +1226,7 @@
"stopCastingBody": "您想停止投放吗?",
"castIPMismatchTitle": "投放相册失败",
"castIPMismatchBody": "请确保您的设备与电视处于同一网络。",
- "pairingComplete": "配对完成"
+ "pairingComplete": "配对完成",
+ "faceRecognition": "Face recognition",
+ "faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
}
\ No newline at end of file
diff --git a/mobile/lib/ui/settings/machine_learning_settings_page.dart b/mobile/lib/ui/settings/machine_learning_settings_page.dart
index 3306ea36f7..b7ce00953a 100644
--- a/mobile/lib/ui/settings/machine_learning_settings_page.dart
+++ b/mobile/lib/ui/settings/machine_learning_settings_page.dart
@@ -6,6 +6,7 @@ import "package:photos/core/event_bus.dart";
import 'package:photos/events/embedding_updated_event.dart';
import "package:photos/generated/l10n.dart";
import "package:photos/service_locator.dart";
+import "package:photos/services/machine_learning/face_ml/face_ml_service.dart";
import 'package:photos/services/machine_learning/semantic_search/frameworks/ml_framework.dart';
import 'package:photos/services/machine_learning/semantic_search/semantic_search_service.dart';
import "package:photos/theme/ente_theme.dart";
@@ -89,6 +90,8 @@ class _MachineLearningSettingsPageState
mainAxisSize: MainAxisSize.min,
children: [
_getMagicSearchSettings(context),
+ const SizedBox(height: 12),
+ _getFacesSearchSettings(context),
],
),
),
@@ -147,7 +150,7 @@ class _MachineLearningSettingsPageState
children: [
_state == InitializationState.initialized
? const MagicSearchIndexStatsWidget()
- : ModelLoadingState(_state),
+ : MagicSearchModelLoadingState(_state),
const SizedBox(
height: 12,
),
@@ -174,12 +177,54 @@ class _MachineLearningSettingsPageState
],
);
}
+
+ Widget _getFacesSearchSettings(BuildContext context) {
+ final colorScheme = getEnteColorScheme(context);
+ final hasEnabled = LocalSettings.instance.isFaceIndexingEnabled;
+ return Column(
+ children: [
+ MenuItemWidget(
+ captionedTextWidget: CaptionedTextWidget(
+ title: S.of(context).faceRecognition,
+ ),
+ menuItemColor: colorScheme.fillFaint,
+ trailingWidget: ToggleSwitchWidget(
+ value: () => LocalSettings.instance.isFaceIndexingEnabled,
+ onChanged: () async {
+ final isEnabled =
+ await LocalSettings.instance.toggleFaceIndexing();
+ if (isEnabled) {
+ unawaited(FaceMlService.instance.ensureInitialized());
+ } else {
+ FaceMlService.instance.pauseIndexing();
+ }
+ if (mounted) {
+ setState(() {});
+ }
+ },
+ ),
+ singleBorderRadius: 8,
+ alignCaptionedTextToLeft: true,
+ isGestureDetectorDisabled: true,
+ ),
+ const SizedBox(
+ height: 4,
+ ),
+ MenuSectionDescriptionWidget(
+ content: S.of(context).faceRecognitionIndexingDescription,
+ ),
+ const SizedBox(
+ height: 12,
+ ),
+ ],
+ );
+ }
}
-class ModelLoadingState extends StatelessWidget {
+class MagicSearchModelLoadingState extends StatelessWidget {
final InitializationState state;
- const ModelLoadingState(
+ const MagicSearchModelLoadingState(
this.state, {
Key? key,
}) : super(key: key);