|
|
|
@ -13,16 +13,13 @@ extension CapExtension on String {
|
|
|
|
|
|
|
|
|
|
|
|
String get allInCaps => this.toUpperCase();
|
|
|
|
String get allInCaps => this.toUpperCase();
|
|
|
|
|
|
|
|
|
|
|
|
String get capitalizeFirstofEach =>
|
|
|
|
String get capitalizeFirstofEach => this.trim().length > 0 ? this.trim().toLowerCase().split(" ").map((str) => str.inCaps).join(" ") : "";
|
|
|
|
this.trim().length > 0 ? this.trim().toLowerCase().split(" ").map((str) => str.inCaps).join(" ") : "";
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
extension EmailValidator on String {
|
|
|
|
extension EmailValidator on String {
|
|
|
|
Widget get toWidget => Text(this);
|
|
|
|
Widget get toWidget => Text(this);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText8(
|
|
|
|
Widget toText8({Color? color, bool isBold = false, int? maxlines, FontStyle? fontStyle, TextOverflow? textOverflow}) => Text(
|
|
|
|
{Color? color, bool isBold = false, int? maxlines, FontStyle? fontStyle, TextOverflow? textOverflow}) =>
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
maxLines: maxlines,
|
|
|
|
maxLines: maxlines,
|
|
|
|
overflow: textOverflow,
|
|
|
|
overflow: textOverflow,
|
|
|
|
@ -35,14 +32,7 @@ extension EmailValidator on String {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText10(
|
|
|
|
Widget toText10({Color? color, bool isBold = false, bool isUnderLine = false, int? maxlines, FontStyle? fontStyle, TextOverflow? textOverflow}) => Text(
|
|
|
|
{Color? color,
|
|
|
|
|
|
|
|
bool isBold = false,
|
|
|
|
|
|
|
|
bool isUnderLine = false,
|
|
|
|
|
|
|
|
int? maxlines,
|
|
|
|
|
|
|
|
FontStyle? fontStyle,
|
|
|
|
|
|
|
|
TextOverflow? textOverflow}) =>
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
maxLines: maxlines,
|
|
|
|
maxLines: maxlines,
|
|
|
|
overflow: textOverflow,
|
|
|
|
overflow: textOverflow,
|
|
|
|
@ -56,15 +46,7 @@ extension EmailValidator on String {
|
|
|
|
decorationColor: color ?? AppColors.blackColor),
|
|
|
|
decorationColor: color ?? AppColors.blackColor),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText11(
|
|
|
|
Widget toText11({Color? color, FontWeight? weight, bool isUnderLine = false, bool isCenter = false, bool isBold = false, int maxLine = 0, double letterSpacing = 0.64}) => Text(
|
|
|
|
{Color? color,
|
|
|
|
|
|
|
|
FontWeight? weight,
|
|
|
|
|
|
|
|
bool isUnderLine = false,
|
|
|
|
|
|
|
|
bool isCenter = false,
|
|
|
|
|
|
|
|
bool isBold = false,
|
|
|
|
|
|
|
|
int maxLine = 0,
|
|
|
|
|
|
|
|
double letterSpacing = 0.64}) =>
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
maxLines: (maxLine > 0) ? maxLine : null,
|
|
|
|
maxLines: (maxLine > 0) ? maxLine : null,
|
|
|
|
@ -78,20 +60,11 @@ extension EmailValidator on String {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText12(
|
|
|
|
Widget toText12({Color? color, bool isUnderLine = false, bool isBold = false, FontWeight? fontWeight, bool isCenter = false, double? height, int maxLine = 0}) => Text(
|
|
|
|
{Color? color,
|
|
|
|
|
|
|
|
bool isUnderLine = false,
|
|
|
|
|
|
|
|
bool isBold = false,
|
|
|
|
|
|
|
|
FontWeight? fontWeight,
|
|
|
|
|
|
|
|
bool isCenter = false,
|
|
|
|
|
|
|
|
double? height,
|
|
|
|
|
|
|
|
int maxLine = 0}) =>
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
maxLines: (maxLine > 0) ? maxLine : null,
|
|
|
|
maxLines: (maxLine > 0) ? maxLine : null,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
|
|
|
|
fontSize: 12.fSize,
|
|
|
|
fontSize: 12.fSize,
|
|
|
|
fontWeight: fontWeight ?? (isBold ? FontWeight.bold : FontWeight.normal),
|
|
|
|
fontWeight: fontWeight ?? (isBold ? FontWeight.bold : FontWeight.normal),
|
|
|
|
color: color ?? AppColors.blackColor,
|
|
|
|
color: color ?? AppColors.blackColor,
|
|
|
|
@ -102,9 +75,7 @@ extension EmailValidator on String {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText12Auto(
|
|
|
|
Widget toText12Auto({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, int maxLine = 0}) => AutoSizeText(
|
|
|
|
{Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, int maxLine = 0}) =>
|
|
|
|
|
|
|
|
AutoSizeText(
|
|
|
|
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
maxLines: (maxLine > 0) ? maxLine : null,
|
|
|
|
maxLines: (maxLine > 0) ? maxLine : null,
|
|
|
|
@ -165,14 +136,7 @@ extension EmailValidator on String {
|
|
|
|
decoration: isUnderLine ? TextDecoration.underline : null),
|
|
|
|
decoration: isUnderLine ? TextDecoration.underline : null),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText14(
|
|
|
|
Widget toText14({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, FontWeight? weight, int? maxlines}) => Text(
|
|
|
|
{Color? color,
|
|
|
|
|
|
|
|
bool isUnderLine = false,
|
|
|
|
|
|
|
|
bool isBold = false,
|
|
|
|
|
|
|
|
bool isCenter = false,
|
|
|
|
|
|
|
|
FontWeight? weight,
|
|
|
|
|
|
|
|
int? maxlines}) =>
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
maxLines: maxlines,
|
|
|
|
maxLines: maxlines,
|
|
|
|
@ -184,14 +148,7 @@ extension EmailValidator on String {
|
|
|
|
decoration: isUnderLine ? TextDecoration.underline : null),
|
|
|
|
decoration: isUnderLine ? TextDecoration.underline : null),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText15(
|
|
|
|
Widget toText15({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, FontWeight? weight, int? maxlines}) => Text(
|
|
|
|
{Color? color,
|
|
|
|
|
|
|
|
bool isUnderLine = false,
|
|
|
|
|
|
|
|
bool isBold = false,
|
|
|
|
|
|
|
|
bool isCenter = false,
|
|
|
|
|
|
|
|
FontWeight? weight,
|
|
|
|
|
|
|
|
int? maxlines}) =>
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
maxLines: maxlines,
|
|
|
|
maxLines: maxlines,
|
|
|
|
@ -227,40 +184,24 @@ extension EmailValidator on String {
|
|
|
|
Widget toText17({Color? color, bool isBold = false, bool isCenter = false}) => Text(
|
|
|
|
Widget toText17({Color? color, bool isBold = false, bool isCenter = false}) => Text(
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(color: color ?? AppColors.blackColor, fontSize: 17.fSize, letterSpacing: -0.4, fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
|
|
|
|
color: color ?? AppColors.blackColor,
|
|
|
|
|
|
|
|
fontSize: 17.fSize,
|
|
|
|
|
|
|
|
letterSpacing: -0.4,
|
|
|
|
|
|
|
|
fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText18({Color? color, bool isBold = false, bool isCenter = false, int? maxlines}) => Text(
|
|
|
|
Widget toText18({Color? color, bool isBold = false, bool isCenter = false, int? maxlines}) => Text(
|
|
|
|
maxLines: maxlines,
|
|
|
|
maxLines: maxlines,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontSize: 18.fSize, fontWeight: isBold ? FontWeight.bold : FontWeight.normal, color: color ?? AppColors.blackColor, letterSpacing: -0.4),
|
|
|
|
fontSize: 18.fSize,
|
|
|
|
|
|
|
|
fontWeight: isBold ? FontWeight.bold : FontWeight.normal,
|
|
|
|
|
|
|
|
color: color ?? AppColors.blackColor,
|
|
|
|
|
|
|
|
letterSpacing: -0.4),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText19({Color? color, bool isBold = false}) => Text(
|
|
|
|
Widget toText19({Color? color, bool isBold = false}) => Text(
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontSize: 19.fSize, fontWeight: isBold ? FontWeight.bold : FontWeight.normal, color: color ?? AppColors.blackColor, letterSpacing: -0.4),
|
|
|
|
fontSize: 19.fSize,
|
|
|
|
|
|
|
|
fontWeight: isBold ? FontWeight.bold : FontWeight.normal,
|
|
|
|
|
|
|
|
color: color ?? AppColors.blackColor,
|
|
|
|
|
|
|
|
letterSpacing: -0.4),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText20({Color? color, bool isBold = false}) => Text(
|
|
|
|
Widget toText20({Color? color, bool isBold = false}) => Text(
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(fontSize: 20.fSize, fontWeight: isBold ? FontWeight.bold : FontWeight.normal, color: color ?? AppColors.blackColor, letterSpacing: -0.4),
|
|
|
|
fontSize: 20.fSize,
|
|
|
|
|
|
|
|
fontWeight: isBold ? FontWeight.bold : FontWeight.normal,
|
|
|
|
|
|
|
|
color: color ?? AppColors.blackColor,
|
|
|
|
|
|
|
|
letterSpacing: -0.4),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText21({Color? color, bool isBold = false, FontWeight? weight, int? maxlines}) => Text(
|
|
|
|
Widget toText21({Color? color, bool isBold = false, FontWeight? weight, int? maxlines}) => Text(
|
|
|
|
@ -272,34 +213,34 @@ extension EmailValidator on String {
|
|
|
|
Widget toText22({Color? color, bool isBold = false, bool isCenter = false}) => Text(
|
|
|
|
Widget toText22({Color? color, bool isBold = false, bool isCenter = false}) => Text(
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(height: 1, color: color ?? AppColors.blackColor, fontSize: 22.fSize, letterSpacing: -0.4, fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
|
|
|
|
height: 1,
|
|
|
|
|
|
|
|
color: color ?? AppColors.blackColor,
|
|
|
|
|
|
|
|
fontSize: 22.fSize,
|
|
|
|
|
|
|
|
letterSpacing: -0.4,
|
|
|
|
|
|
|
|
fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText24({Color? color, bool isBold = false, bool isCenter = false}) => Text(
|
|
|
|
Widget toText24({Color? color, bool isBold = false, bool isCenter = false}) => Text(
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(height: 23 / 24, color: color ?? AppColors.blackColor, fontSize: 24.fSize, letterSpacing: -0.4, fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
|
|
|
|
height: 23 / 24,
|
|
|
|
);
|
|
|
|
color: color ?? AppColors.blackColor,
|
|
|
|
|
|
|
|
fontSize: 24.fSize,
|
|
|
|
Widget toText26({Color? color, bool isBold = false, double? height, bool isCenter = false}) => Text(
|
|
|
|
letterSpacing: -0.4,
|
|
|
|
this,
|
|
|
|
fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
|
|
|
|
style: TextStyle(height: height ?? 23 / 26, color: color ?? AppColors.blackColor, fontSize: 26.fSize, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText28({Color? color, bool isBold = false, double? height, bool isCenter = false}) => Text(
|
|
|
|
|
|
|
|
this,
|
|
|
|
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
|
|
|
|
style: TextStyle(height: height ?? 23 / 28, color: color ?? AppColors.blackColor, fontSize: 28.fSize, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText32({Color? color, bool isBold = false, bool isCenter = false}) => Text(
|
|
|
|
Widget toText32({Color? color, bool isBold = false, bool isCenter = false}) => Text(
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
textAlign: isCenter ? TextAlign.center : null,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(height: 32 / 32, color: color ?? AppColors.blackColor, fontSize: 32.fSize, letterSpacing: -0.4, fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
|
|
|
|
height: 32 / 32,
|
|
|
|
|
|
|
|
color: color ?? AppColors.blackColor,
|
|
|
|
|
|
|
|
fontSize: 32.fSize,
|
|
|
|
|
|
|
|
letterSpacing: -0.4,
|
|
|
|
|
|
|
|
fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText44({Color? color, bool isBold = false}) => Text(
|
|
|
|
Widget toText44({Color? color, bool isBold = false}) => Text(
|
|
|
|
@ -340,9 +281,7 @@ extension EmailValidator on String {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool isValidEmail() {
|
|
|
|
bool isValidEmail() {
|
|
|
|
return RegExp(
|
|
|
|
return RegExp(r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$').hasMatch(this);
|
|
|
|
r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$')
|
|
|
|
|
|
|
|
.hasMatch(this);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String toFormattedDate() {
|
|
|
|
String toFormattedDate() {
|
|
|
|
|