localizely_sdk 1.1.0
localizely_sdk: ^1.1.0 copied to clipboard
Localizely SDK for Flutter enables Over-the-air translations update from Localizely cloud platform
Localizely SDK #
SDK setup #
- Update
pubspec.yaml
file:
dependencies:
...
localizely_sdk: ^1.1.0
flutter_intl:
...
localizely:
ota_enabled: true # Required for Over-the-air translation updates
-
Trigger localization files generation by Flutter Intl IDE plugin or by intl_utils library
-
Initialize Localizely SDK (e.g.
main.dart
file):
import 'package:localizely_sdk/localizely_sdk.dart'; // import sdk package
void main() {
Localizely.init('<SDK_TOKEN>', '<DISTIRIBUTION_ID>'); // init sdk
Localizely.setPreRelease(true); // Add this only if you want to use prereleases
runApp(MyApp());
}
// Update translations and setState with callback
Localizely.updateTranslations().then(
(response) => setState(() => print('Translations fetched')),
onError: (error) => print('Error occurred'));