diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart index 723245ef..eabd9fce 100644 --- a/lib/extensions/string_extensions.dart +++ b/lib/extensions/string_extensions.dart @@ -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 { try { DateTime dateTime = DateTime.parse(this); @@ -38,6 +47,7 @@ extension StringExtensions on String { return ""; } } + String get toYMDHMSA { try { DateTime dateTime = DateTime.parse(this); @@ -46,6 +56,7 @@ extension StringExtensions on String { return ""; } } + String get toMonthYearFormat { try { DateTime dateTime = DateTime.parse(this); diff --git a/lib/new_views/common_widgets/working_time_tile.dart b/lib/new_views/common_widgets/working_time_tile.dart index 94a8b820..6536a4e7 100644 --- a/lib/new_views/common_widgets/working_time_tile.dart +++ b/lib/new_views/common_widgets/working_time_tile.dart @@ -29,12 +29,12 @@ class WorkingTimeTile extends StatelessWidget { decoration: BoxDecoration( color: AppColor.fieldBgColor(context), borderRadius: BorderRadius.circular(10), - boxShadow: [ - BoxShadow( - color: Colors.black.withOpacity(0.05), - blurRadius: 10, - ) - ], + // boxShadow: [ + // BoxShadow( + // color: Colors.black.withOpacity(0.05), + // blurRadius: 10, + // ) + // ], ), child: Row( children: [ @@ -46,9 +46,9 @@ class WorkingTimeTile extends StatelessWidget { Text( title, style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: context.isDark ? null : AppColor.neutral20, - fontWeight: FontWeight.w500, - ), + color: context.isDark ? null : AppColor.neutral20, + fontWeight: FontWeight.w500, + ), ), Text( " ${ServiceRequestUtils.formatTotalWorkingHours(totalWorkingTime)}", @@ -60,17 +60,16 @@ class WorkingTimeTile extends StatelessWidget { const Icon(Icons.info_outline_rounded, color: AppColor.primary10), ], ), - ).onPress(() async{ + ).onPress(() async { await showModalBottomSheet( - context: context, - isDismissible: true, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.vertical(top: Radius.circular(20)), - ), - clipBehavior: Clip.antiAliasWithSaveLayer, - builder: (BuildContext context) => - TotalWorkingTimeDetailBottomSheet(timerList: timerList), + context: context, + isDismissible: true, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.vertical(top: Radius.circular(20)), + ), + clipBehavior: Clip.antiAliasWithSaveLayer, + builder: (BuildContext context) => TotalWorkingTimeDetailBottomSheet(timerList: timerList), ); }); } -} \ No newline at end of file +} diff --git a/lib/views/widgets/total_working_time_detail_bottomsheet.dart b/lib/views/widgets/total_working_time_detail_bottomsheet.dart index 6f6f9720..96a20fa6 100644 --- a/lib/views/widgets/total_working_time_detail_bottomsheet.dart +++ b/lib/views/widgets/total_working_time_detail_bottomsheet.dart @@ -48,13 +48,13 @@ class TotalWorkingTimeDetailBottomSheet extends StatelessWidget { text: TextSpan( text: "From: ", 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, RichText( text: TextSpan( text: "To: ", 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, RichText( text: TextSpan(