|
@@ -40,13 +40,13 @@ class MyTextView extends StatelessWidget {
|
|
|
Color? borderColor = Colors.transparent;
|
|
|
String content = "";
|
|
|
bool? singleLine = false;
|
|
|
- bool? isBold = false;
|
|
|
VoidCallback? onClick;
|
|
|
bool? isFontLight;
|
|
|
bool? isFontRegular;
|
|
|
bool? isFontMedium;
|
|
|
bool? isFontBold;
|
|
|
FontWeight? fontWeight;
|
|
|
+ TextAlign? textAlign;
|
|
|
|
|
|
MyTextView(this.content,
|
|
|
{this.textColor,
|
|
@@ -66,14 +66,13 @@ class MyTextView extends StatelessWidget {
|
|
|
this.margin,
|
|
|
this.fontSize,
|
|
|
this.singleLine,
|
|
|
- this.isBold,
|
|
|
this.isFontLight,
|
|
|
this.isFontRegular,
|
|
|
this.isFontMedium,
|
|
|
this.isFontBold,
|
|
|
this.fontWeight,
|
|
|
+ this.textAlign,
|
|
|
this.onClick}) {
|
|
|
-
|
|
|
if (padding != null) {
|
|
|
if (padding != null && padding! > 0) {
|
|
|
paddingLeft = padding;
|
|
@@ -95,25 +94,15 @@ class MyTextView extends StatelessWidget {
|
|
|
onClick ??= () {};
|
|
|
|
|
|
if (isFontLight != null && isFontLight!) {
|
|
|
-
|
|
|
- fontWeight = FontWeight.w300;
|
|
|
-
|
|
|
+ fontWeight = FontWeight.w300;
|
|
|
} else if (isFontRegular != null && isFontRegular!) {
|
|
|
-
|
|
|
fontWeight = FontWeight.w400;
|
|
|
-
|
|
|
} else if (isFontMedium != null && isFontMedium!) {
|
|
|
-
|
|
|
fontWeight = FontWeight.w500;
|
|
|
-
|
|
|
} else if (isFontBold != null && isFontBold!) {
|
|
|
-
|
|
|
fontWeight = FontWeight.w700;
|
|
|
-
|
|
|
- } else {
|
|
|
-
|
|
|
+ } else {
|
|
|
fontWeight = FontWeight.normal;
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -131,6 +120,7 @@ class MyTextView extends StatelessWidget {
|
|
|
onTap: onClick,
|
|
|
child: Text(
|
|
|
content,
|
|
|
+ textAlign: textAlign ?? TextAlign.start,
|
|
|
style: TextStyle(
|
|
|
color: textColor,
|
|
|
fontSize: fontSize ?? 14,
|