Full examples project for flutter.
For help getting started with Flutter, view our online documentation.
Specification
- localization
- folder structures
- models, screens, shared_widgets, utils
project/
├─ android
├─ ios
├─ lib
│ └─ models // models used in project
│ └─ screens // list of screens
│ └─ shared_widgets // widgets that is used in screens multiply
│ └─ utils // useful materials - localization, theme, general
│ └─ main.dart // root of dart file
├─ res/
│ └─ icons
│ └─ langs
├─ test/
├─ .metadata
├─ .gitignore
├─ .packages
├─ .flutter_examples.iml
├─ .flutter_examples_android.iml
├─ .pubspec.lock
├─ .pubspec.yaml
└─ README.md
pub get
flutter run ios
flutter run android
We've defined Localization strings in json which is placed in res/langs
dir.
We used flutter_localizations pacakage for localization.
import '../utils/localization.dart' show Localization;
var localization = Localization.of(context); /// We need context to be passed.
/// In widget
Text(localization.trans('LOADING'));