localize_and_translate 4.1.2-dev
localize_and_translate: ^4.1.2-dev copied to clipboard
Flutter localization in easy steps, simple ways to localize and translate your app
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:localize_and_translate/localize_and_translate.dart';
import 'package:localize_and_translate_example/views/entry_point.dart';
Future<void> main() async {
// if your flutter > 1.7.8 : ensure flutter activated
WidgetsFlutterBinding.ensureInitialized();
await translator.init(
localeType: LocalizationDefaultType.device,
languagesList: <String>['ar', 'en'],
assetsDirectory: 'assets/lang/',
);
runApp(
const LocalizedApp(
child: MyApp(),
),
);
}