rerune 1.0.0
rerune: ^1.0.0 copied to clipboard
OTA localization for Flutter: update translations and add languages without an app release while keeping generated AppLocalizations APIs.
example/example.dart
import 'package:rerune/rerune.dart';
/// Initializes ReRune with the localization config generated for your app.
///
/// Pass `reRuneAppLocalizationsConfig`, generated by `dart run rerune`, as
/// [localizations].
Future<void> initializeReRune({
required String otaPublishId,
required ReRuneLocalizationsConfig<dynamic> localizations,
}) {
return ReRune.setup(
otaPublishId: otaPublishId,
localizations: localizations,
updatePolicy: const ReRuneUpdatePolicy(
checkOnStart: true,
periodicIntervalInHours: 6,
),
);
}
/// Requests an immediate translation refresh.
Future<ReRuneUpdateResult> refreshTranslations() {
return ReRune.checkForUpdates();
}