linguaflow library

LinguaFlow — AI-powered localization for Flutter apps.

Quick start

// 1. Wrap your app
LinguaFlowProvider(
  config: LocaleConfig(
    fallbackLocale: 'en',
    supportedLocales: ['en', 'hi', 'fr'],
  ),
  aiProvider: OpenAiProvider(apiKey: 'sk-...'),
  child: MyApp(),
)

// 2. Translate strings
Text('welcome'.tr(context))

// 3. Switch locale
LinguaFlow.of(context).setLocale('hi');

Classes

AiProvider
Abstract interface for AI translation backends.
AiProviderFactory
Factory for creating AiProvider instances from multiple sources.
CacheManager
Persists AI-generated translations across app sessions using SharedPreferences.
ClaudeProvider
Anthropic Claude translation provider.
DeepLProvider
DeepL translation provider — specialized for high-quality translations.
FileLoader
Loads JSON translation files from the app's asset bundle.
GeminiProvider
Google Gemini translation provider.
LibreTranslateProvider
LibreTranslate provider — free & open-source translation.
LinguaFlow
Convenience accessor — call anywhere inside the widget tree.
LinguaFlowConstants
Internal constants used across LinguaFlow.
LinguaFlowProvider
Wraps your app to provide LinguaFlow localization capabilities.
LocaleConfig
Configuration passed to LinguaFlowProvider during initialization.
LocaleManager
Central manager for locale state.
NvidiaProvider
NVIDIA NIM translation provider.
OpenAiProvider
OpenAI-powered translation provider.
StorageService
Persists and retrieves the user's chosen locale across app launches.
TranslationStore
Holds all loaded translations in memory.

Enums

AiProviderType
Supported AI translation providers.

Extensions

AiProviderTypeX on AiProviderType
TranslateExtension on String
Adds .tr(context) to every String.