forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync_confirmation.dart
More file actions
30 lines (28 loc) · 1.25 KB
/
Copy pathsync_confirmation.dart
File metadata and controls
30 lines (28 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import 'package:flutter/material.dart';
import 'package:omi/backend/preferences.dart';
import 'package:omi/widgets/omi_confirm_dialog.dart';
import 'package:omi/utils/l10n_extensions.dart';
/// Confirmation gate for manually syncing offline recordings.
///
/// Users on a third-party (custom) STT provider transcribe live on their own
/// provider, so their recordings normally never touch Omi's STT. Offline files,
/// however, can only be processed on Omi's servers — which means they DO use
/// Omi transcription and count toward the plan limit. Auto-sync is disabled for
/// these users (see capture/sync providers); when they manually press Sync we
/// surface this trade-off and let them opt in per their choice.
///
/// Returns `true` when the sync should proceed. For non-custom-STT users this is
/// a no-op that always returns `true` (no dialog).
Future<bool> confirmSyncForCustomStt(BuildContext context) async {
if (!SharedPreferencesUtil().useCustomStt) return true;
final l = context.l10n;
final confirmed = await OmiConfirmDialog.show(
context,
title: l.syncCustomSttWarningTitle,
message: l.syncCustomSttWarningMessage,
confirmLabel: l.sync,
cancelLabel: l.cancel,
confirmColor: Colors.white,
);
return confirmed ?? false;
}