clean up
This commit is contained in:
61
lib/pages/widgets/local_text.dart
Normal file
61
lib/pages/widgets/local_text.dart
Normal file
@@ -0,0 +1,61 @@
|
||||
import 'package:fcs/localization/app_translations.dart';
|
||||
import 'package:fcs/pages/main/model/language_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
|
||||
class LocalText extends Text {
|
||||
final BuildContext context;
|
||||
LocalText(this.context, String translationKey,
|
||||
{Color color,
|
||||
double fontSize,
|
||||
FontWeight fontWeight,
|
||||
List<String> translationVariables,
|
||||
String text,
|
||||
bool underline = false})
|
||||
: super(
|
||||
text ??
|
||||
AppTranslations.of(context).text(translationKey,
|
||||
translationVariables: translationVariables),
|
||||
style: Provider.of<LanguageModel>(context, listen: false).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: "Myanmar3"));
|
||||
}
|
||||
|
||||
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: "Myanmar3",
|
||||
fontSize: fontSize,
|
||||
fontWeight: fontWeight));
|
||||
}
|
||||
Reference in New Issue
Block a user