improvement

design_3.0_TM_Module_snagsFix
Sikander Saleem 1 month ago
parent ee70ca3c2b
commit 3ac3c11b4b

@ -30,6 +30,15 @@ extension StringExtensions on String {
} }
} }
String get toServiceRequestDetailsFormatWithSS {
try {
DateTime dateTime = DateTime.parse(this);
return "${DateFormat('dd MMM, yyyy').format(dateTime)} ${DateFormat('hh:mm:ss a').format(dateTime)}";
} catch (e) {
return "";
}
}
String get toFirstActionFormat { String get toFirstActionFormat {
try { try {
DateTime dateTime = DateTime.parse(this); DateTime dateTime = DateTime.parse(this);
@ -38,6 +47,7 @@ extension StringExtensions on String {
return ""; return "";
} }
} }
String get toYMDHMSA { String get toYMDHMSA {
try { try {
DateTime dateTime = DateTime.parse(this); DateTime dateTime = DateTime.parse(this);
@ -46,6 +56,7 @@ extension StringExtensions on String {
return ""; return "";
} }
} }
String get toMonthYearFormat { String get toMonthYearFormat {
try { try {
DateTime dateTime = DateTime.parse(this); DateTime dateTime = DateTime.parse(this);

@ -29,12 +29,12 @@ class WorkingTimeTile extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColor.fieldBgColor(context), color: AppColor.fieldBgColor(context),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
boxShadow: [ // boxShadow: [
BoxShadow( // BoxShadow(
color: Colors.black.withOpacity(0.05), // color: Colors.black.withOpacity(0.05),
blurRadius: 10, // blurRadius: 10,
) // )
], // ],
), ),
child: Row( child: Row(
children: [ children: [
@ -46,9 +46,9 @@ class WorkingTimeTile extends StatelessWidget {
Text( Text(
title, title,
style: Theme.of(context).textTheme.bodySmall?.copyWith( style: Theme.of(context).textTheme.bodySmall?.copyWith(
color: context.isDark ? null : AppColor.neutral20, color: context.isDark ? null : AppColor.neutral20,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
), ),
Text( Text(
" ${ServiceRequestUtils.formatTotalWorkingHours(totalWorkingTime)}", " ${ServiceRequestUtils.formatTotalWorkingHours(totalWorkingTime)}",
@ -60,17 +60,16 @@ class WorkingTimeTile extends StatelessWidget {
const Icon(Icons.info_outline_rounded, color: AppColor.primary10), const Icon(Icons.info_outline_rounded, color: AppColor.primary10),
], ],
), ),
).onPress(() async{ ).onPress(() async {
await showModalBottomSheet( await showModalBottomSheet(
context: context, context: context,
isDismissible: true, isDismissible: true,
shape: const RoundedRectangleBorder( shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(20)), borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
), ),
clipBehavior: Clip.antiAliasWithSaveLayer, clipBehavior: Clip.antiAliasWithSaveLayer,
builder: (BuildContext context) => builder: (BuildContext context) => TotalWorkingTimeDetailBottomSheet(timerList: timerList),
TotalWorkingTimeDetailBottomSheet(timerList: timerList),
); );
}); });
} }
} }

@ -48,13 +48,13 @@ class TotalWorkingTimeDetailBottomSheet extends StatelessWidget {
text: TextSpan( text: TextSpan(
text: "From: ", text: "From: ",
style: Theme.of(context).textTheme.bodySmall?.copyWith(color: context.isDark ? null : AppColor.neutral20, fontWeight: FontWeight.w500), style: Theme.of(context).textTheme.bodySmall?.copyWith(color: context.isDark ? null : AppColor.neutral20, fontWeight: FontWeight.w500),
children: [TextSpan(text: timerList[index].startTime!.toServiceRequestDetailsFormat, style: Theme.of(context).textTheme.bodySmall)])), children: [TextSpan(text: timerList[index].startTime!.toServiceRequestDetailsFormatWithSS, style: Theme.of(context).textTheme.bodySmall)])),
4.height, 4.height,
RichText( RichText(
text: TextSpan( text: TextSpan(
text: "To: ", text: "To: ",
style: Theme.of(context).textTheme.bodySmall?.copyWith(color: context.isDark ? null : AppColor.neutral20, fontWeight: FontWeight.w500), style: Theme.of(context).textTheme.bodySmall?.copyWith(color: context.isDark ? null : AppColor.neutral20, fontWeight: FontWeight.w500),
children: [TextSpan(text: timerList[index].endTime!.toServiceRequestDetailsFormat, style: Theme.of(context).textTheme.bodySmall)])), children: [TextSpan(text: timerList[index].endTime!.toServiceRequestDetailsFormatWithSS, style: Theme.of(context).textTheme.bodySmall)])),
4.height, 4.height,
RichText( RichText(
text: TextSpan( text: TextSpan(

Loading…
Cancel
Save