Files
fcs/lib/pages/widgets/local_text.dart

62 lines
2.1 KiB
Dart
Raw Normal View History

2020-10-07 02:33:06 +06:30
import 'package:fcs/localization/app_translations.dart';
import 'package:fcs/pages/main/model/language_model.dart';
2020-09-04 15:30:10 +06:30
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
2020-10-07 02:33:06 +06:30
import 'package:fcs/helpers/theme.dart';
2020-09-04 15:30:10 +06:30
class LocalText extends Text {
final BuildContext context;
LocalText(this.context, String translationKey,
{Color color,
double fontSize,
FontWeight fontWeight,
List<String> translationVariables,
2020-09-18 21:33:41 +06:30
String text,
2020-09-04 15:30:10 +06:30
bool underline = false})
: super(
2020-09-18 21:33:41 +06:30
text ??
AppTranslations.of(context).text(translationKey,
translationVariables: translationVariables),
2020-09-16 02:29:50 +06:30
style: Provider.of<LanguageModel>(context, listen: false).isEng
2020-09-04 15:30:10 +06:30
? newLabelStyle(
color: color,
fontSize: fontSize,
fontWeight: fontWeight,
underline: underline)
: newLabelStyleMM(
color: color,
fontSize: fontSize,
fontWeight: fontWeight,
underline: underline));
}
2020-09-07 16:05:28 +06:30
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)
2020-10-07 02:33:06 +06:30
: TextStyle(color: color, fontFamily: "Myanmar3"));
2020-09-07 16:05:28 +06:30
}
class TextLocalStyle extends Text {
final BuildContext context;
2020-09-16 02:29:50 +06:30
TextLocalStyle(this.context, String text,
{Color color, double fontSize, FontWeight fontWeight})
2020-09-07 16:05:28 +06:30
: super(text,
style: Provider.of<LanguageModel>(context).isEng
2020-09-16 02:29:50 +06:30
? TextStyle(
color: color, fontSize: fontSize, fontWeight: fontWeight)
2020-09-07 16:05:28 +06:30
: TextStyle(
color: color,
2020-10-07 02:33:06 +06:30
fontFamily: "Myanmar3",
2020-09-16 02:29:50 +06:30
fontSize: fontSize,
fontWeight: fontWeight));
2020-09-07 16:05:28 +06:30
}