From 576dd8914f7d881b40e2cbf284f5b493ffca464c Mon Sep 17 00:00:00 2001 From: ivirtex Date: Thu, 26 Oct 2023 00:50:57 +0200 Subject: [PATCH] Improve date formatting --- lib/launches/widgets/launch_card.dart | 39 +++++++++++++++++++++------ 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/lib/launches/widgets/launch_card.dart b/lib/launches/widgets/launch_card.dart index 866cf59..603c319 100644 --- a/lib/launches/widgets/launch_card.dart +++ b/lib/launches/widgets/launch_card.dart @@ -58,15 +58,38 @@ class LaunchCard extends StatelessWidget { launch.name, style: Theme.of(context).textTheme.titleMedium, ), - Text( - formatDate( - launch.net?.toLocal(), - dateFormat: DateFormat.yMMMd().add_Hm(), - ) ?? - 'N/A', - style: Theme.of(context).textTheme.titleSmall!.copyWith( - color: Theme.of(context).colorScheme.outline, + const SizedBox(height: 5), + RichText( + text: TextSpan( + children: [ + TextSpan( + text: formatDate( + launch.net?.toLocal(), + dateFormat: DateFormat.yMMMd(), + ) ?? + 'N/A', + style: TextStyle( + color: Theme.of(context).colorScheme.tertiary, + ), + ), + TextSpan( + text: ' • ', + style: TextStyle( + color: Theme.of(context).colorScheme.outline, + ), + ), + TextSpan( + text: formatDate( + launch.net?.toLocal(), + dateFormat: DateFormat.Hm(), + ) ?? + 'N/A', + style: TextStyle( + color: Theme.of(context).colorScheme.outline, + ), ), + ], + ), ), const SizedBox(height: 5), Text(