Files
fcs/lib/fcs/common/pages/widgets/local_text.dart
2020-09-07 16:05:28 +06:30

57 lines
2.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));
}
class LocalLargeTitle extends Text {
final BuildContext context;
LocalLargeTitle(
this.context,
String translationKey, {
Color color,
List<String> translationVariables,
}) : super(
AppTranslations.of(context).text(translationKey,
translationVariables: translationVariables),
style: Provider.of<LanguageModel>(context).isEng
? TextStyle(color: color)
: TextStyle(color: color, fontFamily: "MyanmarUnicode"));
}
class TextLocalStyle extends Text {
final BuildContext context;
TextLocalStyle(this.context, String text, {Color color, double fontSize,FontWeight fontWeight})
: super(text,
style: Provider.of<LanguageModel>(context).isEng
? TextStyle(color: color, fontSize: fontSize,fontWeight: fontWeight)
: TextStyle(
color: color,
fontFamily: "MyanmarUnicode",
fontSize: fontSize,fontWeight: fontWeight));
}