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

23 lines
539 B
Dart
Raw Normal View History

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