Files
fcs/lib/widget/local_text.dart
2020-09-10 02:13:22 +06:30

30 lines
1.1 KiB
Dart

import 'package:fcs/fcs/common/localization/app_translations.dart';
import 'package:fcs/fcs/common/pages/model/language_model.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:fcs/fcs/common/helpers/theme.dart';
class LocalText extends Text {
final BuildContext context;
LocalText(this.context, String translationKey,
{Color color,
double fontSize,
FontWeight fontWeight,
List<String> translationVariables,
bool underline = false})
: super(
AppTranslations.of(context).text(translationKey,
translationVariables: translationVariables),
style: Provider.of<LanguageModel>(context).isEng
? newLabelStyle(
color: color,
fontSize: fontSize,
fontWeight: fontWeight,
underline: underline)
: newLabelStyleMM(
color: color,
fontSize: fontSize,
fontWeight: fontWeight,
underline: underline));
}