userFriendlyMessage property

String get userFriendlyMessage

A user-friendly message suitable for UI display (Snackbars, Dialogs).

Implementation

String get userFriendlyMessage {
  return when(
    databaseError: (_) =>
        'A database error occurred. Please try again later.',
    ioError: (_) =>
        'Cannot read or write files. Please check storage permissions.',
    modelLoadError: (_) =>
        'Failed to load the AI model. Please restart the app.',
    invalidInput: (msg) => 'Invalid input: $msg',
    staleSearchHandle: (_) =>
        'The search results are no longer current. Please run the search again.',
    concurrentMutation: (_) =>
        'The underlying collection changed during search. Please try again.',
    internalError: (_) => 'A temporary internal error occurred.',
    unsupportedMigrationVersion: (axis, stored, supported) =>
        'On-device data was written by a newer version of the app ($axis=$stored, this build supports $supported). Please update the app to continue.',
    embeddingFingerprintMismatch: (stored, current, remaining) =>
        'The embedding model changed since this device last indexed your data. Tap "Re-embed" to keep your saved documents or "Reset" to start fresh.',
    unknown: (_) => 'An unknown error occurred.',
  );
}