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

23 lines
574 B
Dart
Raw Normal View History

2022-06-05 19:36:32 +00:00
// ignore_for_file: always_specify_types
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({
2022-06-05 19:36:32 +00:00
final super.key,
2020-12-01 12:26:29 +00:00
this.child,
2022-06-05 19:36:32 +00:00
});
2020-12-01 12:26:29 +00:00
2021-03-15 15:39:44 +00:00
final Widget? child;
2020-12-01 12:26:29 +00:00
@override
2022-06-05 19:36:32 +00:00
Widget build(final BuildContext context) => EasyLocalization(
2022-05-24 18:55:39 +00:00
supportedLocales: const [Locale('ru'), Locale('en')],
2020-12-01 12:26:29 +00:00
path: 'assets/translations',
2022-05-24 18:55:39 +00:00
fallbackLocale: const 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
);
}