Flutter SDK v4 Installation Guide
WOVN Flutter SDK v4 aligns with the iOS/Android v4 architecture so teams can reuse the same workflows. Follow these steps to install the SDK, hook it into your Flutter entry point, and validate that translations flow correctly.
Download and Install the SDK
- Download the SDK file from the link provided by our CS team.
- Unzip the SDK to a convenient location (for example, your Downloads folder).
Script Setup (Recommended)
From the extracted wovnflutter/ folder, run the installer script and follow the prompts. The script asks for your Flutter project and copies the SDK into the project root automatically, so you do not need to move the folder yourself:
cd wovnflutter
./scripts/install.sh
The script installs the SDK and guides you through the required configuration questions.
Manual Setup
If you prefer not to use the script, copy the extracted wovnflutter/ folder into your project root before continuing.
Update pubspec.yaml
dependencies:
wovn_flutter:
path: ./wovnflutter
Update lib/main.dart
Replace your original runApp call with the v4 initialization flow so Flutter mirrors the native SDK lifecycle:
import 'package:flutter/material.dart';
import 'package:wovn_flutter/wovn_flutter.dart';
typedef Text = WovnText;
typedef RichText = WovnRichText;
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Wovn.initialize(
token: 'YOUR_TOKEN',
config: const LocalSettings(
logLevel: 0, // 0 = trace, 2 = warn
translationPreviewMode: false,
),
);
Wovn().changeToSystemLang();
runApp(Wovn.wrapApp(const MyApp()));
}
Import Wovn Widgets
In each file where you want translated text, import the WOVN package and alias Text and RichText to their WOVN counterparts:
import 'package:wovn_flutter/wovn_flutter.dart';
typedef Text = WovnText;
typedef RichText = WovnRichText;
This ensures that all standard text widgets are replaced with WOVN-enabled versions that respond to language changes.
To prevent specific text from being translated (e.g., passwords, API keys, brand names), use isIgnored: true on any text widget or add "WovnIgnore" to the widget's key. See Ignoring Translations for details.
Verify the Setup
- Run
flutter pub getto confirm the new local dependency resolves cleanly. - Launch the app with
flutter run(simulator or device). Successful initialization prints logs such asWovn: initialize: completed successfullywhen translations and settings download. - Register the device’s Client ID for Development Mode by following Enable Development Mode. Filter the logs for
Client ID, copy the value, and add it under Settings → App → Security in the dashboard so preview and reporting features can target this device. - Call the language helpers to confirm runtime switching:
Widgets wrapped in
Wovn().changeLangUsingLocaleString('en');
Wovn().changeToSystemLang();WovnListenableBuilderor text passed throughWovn().translateshould update immediately. - If you hit duplicate
Text/RichTextdefinitions, addhide Text, RichTextto the offending export statements, runflutter clean, and rebuild.