selfprivacy.org.app/lib/config/localization.dart

23 lines
539 B
Dart
Raw Normal View History

2020-12-01 12:26:29 +00:00
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
class Localization extends StatelessWidget {
const Localization({
2021-03-15 15:39:44 +00:00
Key? key,
2020-12-01 12:26:29 +00:00
this.child,
}) : super(key: key);
2021-03-15 15:39:44 +00:00
final Widget? child;
2020-12-01 12:26:29 +00:00
@override
Widget build(BuildContext context) {
return EasyLocalization(
supportedLocales: [Locale('ru'), Locale('en')],
path: 'assets/translations',
2021-03-18 15:02:39 +00:00
fallbackLocale: Locale('en'),
2021-03-15 15:39:44 +00:00
saveLocale: false,
2020-12-01 12:26:29 +00:00
useOnlyLangCode: true,
2021-03-15 15:39:44 +00:00
child: child!,
2020-12-01 12:26:29 +00:00
);
}
}