2020-05-29 07:45:27 +06:30
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:fcs/model/language_model.dart';
|
2020-09-04 15:30:10 +06:30
|
|
|
import 'package:fcs/fcs/common/helpers/theme.dart';
|
2020-05-29 07:45:27 +06:30
|
|
|
|
|
|
|
|
import 'localization/app_translations.dart';
|
|
|
|
|
|
|
|
|
|
class LocalText extends Text {
|
|
|
|
|
final BuildContext context;
|
|
|
|
|
LocalText(this.context, String translationKey,
|
|
|
|
|
{Color color,
|
|
|
|
|
double fontSize,
|
|
|
|
|
FontWeight fontWeight,
|
|
|
|
|
List<String> translationVariables,
|
2020-05-29 16:14:17 +06:30
|
|
|
bool underline = false})
|
2020-05-29 07:45:27 +06:30
|
|
|
: 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));
|
|
|
|
|
}
|