Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Flutter Architecture Blueprints | 1,308 | a year ago | 30 | mit | Dart | |||||
Flutter Architecture Blueprints is a project that introduces MVVM architecture and project structure approaches to developing Flutter apps. | ||||||||||
Slidy | 780 | a month ago | 95 | May 17, 2021 | 4 | apache-2.0 | Dart | |||
CLI package manager and template for Flutter | ||||||||||
Easy_localization | 683 | 5 | 6 | a month ago | 85 | May 13, 2022 | 165 | mit | Dart | |
Easy and Fast internationalizing your Flutter Apps | ||||||||||
Flutter.cn | 404 | 5 days ago | 89 | other | Dart | |||||
Flutter CN docs translation plan, get started from the wiki: https://github.com/cfug/flutter.cn/wiki | ||||||||||
Flutter | 382 | 16 days ago | 4 | mit | Dart | |||||
A boilerplate project for Flutter using RiverPod, Dio, auto_route, Freezed and generated with very_good_cli | ||||||||||
Flutter Translate | 342 | 1 | 2 | 2 months ago | 43 | July 02, 2022 | 2 | other | Dart | |
Flutter Translate is a fully featured localization / internationalization (i18n) library for Flutter. | ||||||||||
Flutter_rounded_date_picker | 296 | 1 | 7 months ago | 18 | September 05, 2022 | 33 | other | Dart | ||
The Flutter plugin that help you can choose dates and years with rounded calendars and customizable themes. | ||||||||||
Flutter_sheet_localization | 239 | 1 | 2 years ago | 8 | June 09, 2021 | 19 | mit | Dart | ||
Generate Flutter localization from a simple online Google Sheets. | ||||||||||
Slang | 221 | 5 | 9 days ago | 103 | May 22, 2022 | 8 | mit | Dart | ||
Type-safe i18n solution for Flutter | ||||||||||
Flutter_i18n | 199 | 12 | 1 | 3 months ago | 60 | June 08, 2022 | 5 | mit | Dart | |
I18n made easy, for Flutter! |
Flutter localization in easy steps
Method | Job |
---|---|
init() |
initialize things, before runApp() |
'word'.tr() |
word translation - string extension |
translate('word') |
word translation |
translate('word',{"key":"value"}) |
word translation with replacement arguments |
setNewLanguage(context,newLanguage:'en',restart: true, remember: true,) |
change language |
isDirectionRTL() |
is Direction RTL check |
currentLanguage |
Active language code |
locale |
Active Locale |
locals() |
Locales list |
delegates |
Localization Delegates |
.json
translation files as assets'assets/lang/ar.json'
| 'assets/lang/en.json'
{
"appTitle": " ",
"buttonTitle": "English",
"textArea": " "
}
flutter:
assets:
- assets/lang/
main()
async
and do the followingWidgetsFlutterBinding.ensureInitialized()
await translator.init();
with neccassry parametersrunApp()
wrap entry class with LocalizedApp()
import 'package:flutter/material.dart';
import 'package:localize_and_translate/localize_and_translate.dart';
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(
LocalizedApp(
child: MyApp(),
),
);
}
LocalizedApp()
child example -> MaterialApp()
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Home(),
localizationsDelegates: translator.delegates, // Android + iOS Delegates
locale: translator.locale, // Active locale
supportedLocales: translator.locals(), // Locals list
);
}
}
translate('appTitle')
setNewLanguage(context, newLanguage: 'ar', remember: true, restart: true);