|
|
|
@ -2,6 +2,7 @@ import 'package:auto_size_text/auto_size_text.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:intl/intl.dart';
|
|
|
|
import 'package:intl/intl.dart';
|
|
|
|
import 'package:hmg_nurses/classes/colors.dart';
|
|
|
|
import 'package:hmg_nurses/classes/colors.dart';
|
|
|
|
|
|
|
|
import 'package:sizer/sizer.dart';
|
|
|
|
|
|
|
|
|
|
|
|
extension CapExtension on String {
|
|
|
|
extension CapExtension on String {
|
|
|
|
String get toCamelCase => "${this[0].toUpperCase()}${this.substring(1)}";
|
|
|
|
String get toCamelCase => "${this[0].toUpperCase()}${this.substring(1)}";
|
|
|
|
@ -19,13 +20,13 @@ extension EmailValidator on String {
|
|
|
|
Widget toText10({Color? color, bool isBold = false, int? maxlines, FontStyle? fontStyle}) => Text(
|
|
|
|
Widget toText10({Color? color, bool isBold = false, int? maxlines, FontStyle? fontStyle}) => Text(
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
maxLines: maxlines,
|
|
|
|
maxLines: maxlines,
|
|
|
|
style: TextStyle(fontSize: 10, fontStyle: fontStyle ?? FontStyle.normal, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4),
|
|
|
|
style: TextStyle(fontSize: 10.sp, fontStyle: fontStyle ?? FontStyle.normal, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText11({Color? color, FontWeight? weight, bool isUnderLine = false, bool isBold = false}) => Text(
|
|
|
|
Widget toText11({Color? color, FontWeight? weight, bool isUnderLine = false, bool isBold = false}) => Text(
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 11,
|
|
|
|
fontSize: 11.sp,
|
|
|
|
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.w600),
|
|
|
|
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.w600),
|
|
|
|
color: color ?? MyColors.darkTextColor,
|
|
|
|
color: color ?? MyColors.darkTextColor,
|
|
|
|
letterSpacing: -0.33,
|
|
|
|
letterSpacing: -0.33,
|
|
|
|
@ -38,7 +39,7 @@ extension EmailValidator on String {
|
|
|
|
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,
|
|
|
|
fontSize: 12.sp,
|
|
|
|
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
|
|
|
|
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
|
|
|
|
color: color ?? MyColors.darkTextColor,
|
|
|
|
color: color ?? MyColors.darkTextColor,
|
|
|
|
letterSpacing: -0.72,
|
|
|
|
letterSpacing: -0.72,
|
|
|
|
@ -52,7 +53,7 @@ extension EmailValidator on String {
|
|
|
|
maxLines: (maxLine > 0) ? maxLine : null,
|
|
|
|
maxLines: (maxLine > 0) ? maxLine : null,
|
|
|
|
minFontSize: 8,
|
|
|
|
minFontSize: 8,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 12,
|
|
|
|
fontSize: 12.sp,
|
|
|
|
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
|
|
|
|
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
|
|
|
|
color: color ?? MyColors.darkTextColor,
|
|
|
|
color: color ?? MyColors.darkTextColor,
|
|
|
|
letterSpacing: -0.72,
|
|
|
|
letterSpacing: -0.72,
|
|
|
|
@ -86,7 +87,7 @@ extension EmailValidator on String {
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText13({Color? color, bool isUnderLine = false}) => Text(
|
|
|
|
Widget toText13({Color? color, bool isUnderLine = false}) => Text(
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
style: TextStyle(fontSize: 13, fontWeight: FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.52, decoration: isUnderLine ? TextDecoration.underline : null),
|
|
|
|
style: TextStyle(fontSize: 13.sp, fontWeight: FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.52, decoration: isUnderLine ? TextDecoration.underline : null),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText14({Color? color, bool isUnderLine = false, bool isBold = false, FontWeight? weight, int? maxlines}) => Text(
|
|
|
|
Widget toText14({Color? color, bool isUnderLine = false, bool isBold = false, FontWeight? weight, int? maxlines}) => Text(
|
|
|
|
@ -94,7 +95,7 @@ extension EmailValidator on String {
|
|
|
|
maxLines: maxlines,
|
|
|
|
maxLines: maxlines,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: color ?? MyColors.darkTextColor,
|
|
|
|
color: color ?? MyColors.darkTextColor,
|
|
|
|
fontSize: 14,
|
|
|
|
fontSize: 14.sp,
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.w600),
|
|
|
|
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.w600),
|
|
|
|
decoration: isUnderLine ? TextDecoration.underline : null),
|
|
|
|
decoration: isUnderLine ? TextDecoration.underline : null),
|
|
|
|
@ -105,7 +106,7 @@ extension EmailValidator on String {
|
|
|
|
maxLines: maxlines,
|
|
|
|
maxLines: maxlines,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: color ?? MyColors.darkTextColor,
|
|
|
|
color: color ?? MyColors.darkTextColor,
|
|
|
|
fontSize: 16,
|
|
|
|
fontSize: 16.sp,
|
|
|
|
letterSpacing: -0.64,
|
|
|
|
letterSpacing: -0.64,
|
|
|
|
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
|
|
|
|
fontWeight: isBold ? FontWeight.bold : FontWeight.w600,
|
|
|
|
decoration: isUnderLine ? TextDecoration.underline : null,
|
|
|
|
decoration: isUnderLine ? TextDecoration.underline : null,
|
|
|
|
@ -114,48 +115,48 @@ extension EmailValidator on String {
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText17({Color? color, bool isBold = false}) => Text(
|
|
|
|
Widget toText17({Color? color, bool isBold = false}) => Text(
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
style: TextStyle(color: color ?? MyColors.darkTextColor, fontSize: 17, letterSpacing: -0.68, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
|
|
|
|
style: TextStyle(color: color ?? MyColors.darkTextColor, fontSize: 17.sp, letterSpacing: -0.68, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText18({Color? color, bool isBold = false}) => Text(
|
|
|
|
Widget toText18({Color? color, bool isBold = false}) => Text(
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
style: TextStyle(fontSize: 18, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -1.08),
|
|
|
|
style: TextStyle(fontSize: 18.sp, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -1.08),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText19({Color? color, bool isBold = false}) => Text(
|
|
|
|
Widget toText19({Color? color, bool isBold = false}) => Text(
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
style: TextStyle(fontSize: 19, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -1.14),
|
|
|
|
style: TextStyle(fontSize: 19.sp, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -1.14),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText20({Color? color, bool isBold = false}) => Text(
|
|
|
|
Widget toText20({Color? color, bool isBold = false}) => Text(
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
style: TextStyle(fontSize: 20, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4),
|
|
|
|
style: TextStyle(fontSize: 20.sp, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, 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(
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
maxLines: maxlines,
|
|
|
|
maxLines: maxlines,
|
|
|
|
style: TextStyle(color: color ?? MyColors.grey3AColor, fontSize: 21, letterSpacing: -0.31, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.w600)),
|
|
|
|
style: TextStyle(color: color ?? MyColors.grey3AColor, fontSize: 21.sp, letterSpacing: -0.31, fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.w600)),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText22({Color? color, bool isBold = false}) => Text(
|
|
|
|
Widget toText22({Color? color, bool isBold = false}) => Text(
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
style: TextStyle(height: 1, color: color ?? MyColors.darkTextColor, fontSize: 22, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
|
|
|
|
style: TextStyle(height: 1, color: color ?? MyColors.darkTextColor, fontSize: 22.sp, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText24({Color? color, bool isBold = false}) => Text(
|
|
|
|
Widget toText24({Color? color, bool isBold = false}) => Text(
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
style: TextStyle(height: 23 / 24, color: color ?? MyColors.darkTextColor, fontSize: 24, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
|
|
|
|
style: TextStyle(height: 23 / 24, color: color ?? MyColors.darkTextColor, fontSize: 24.sp, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText32({Color? color, bool isBold = false}) => Text(
|
|
|
|
Widget toText32({Color? color, bool isBold = false}) => Text(
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
style: TextStyle(height: 32 / 32, color: color ?? MyColors.darkTextColor, fontSize: 32, letterSpacing: -1.92, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
|
|
|
|
style: TextStyle(height: 32 / 32, color: color ?? MyColors.darkTextColor, fontSize: 32.sp, letterSpacing: -1.92, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toText44({Color? color, bool isBold = false}) => Text(
|
|
|
|
Widget toText44({Color? color, bool isBold = false}) => Text(
|
|
|
|
this,
|
|
|
|
this,
|
|
|
|
style: TextStyle(height: 32 / 32, color: color ?? MyColors.darkTextColor, fontSize: 44, letterSpacing: -2.64, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
|
|
|
|
style: TextStyle(height: 32 / 32, color: color ?? MyColors.darkTextColor, fontSize: 44.sp, letterSpacing: -2.64, fontWeight: isBold ? FontWeight.bold : FontWeight.w600),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
Widget toSectionHeading({String upperHeading = "", String lowerHeading = ""}) {
|
|
|
|
Widget toSectionHeading({String upperHeading = "", String lowerHeading = ""}) {
|
|
|
|
|