Skip to content

Commit

Permalink
[schedule] add #130 (add race time to schedule)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrightDV committed Apr 18, 2024
1 parent c518ea1 commit b514efb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/api/race_components.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import 'package:boxbox/Screens/circuit.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:intl/intl.dart';

class Race {
final String round;
Expand Down Expand Up @@ -117,9 +118,13 @@ class RaceListItem extends StatelessWidget {
AppLocalizations.of(context)?.monthAbbreviationNovember,
AppLocalizations.of(context)?.monthAbbreviationDecember,
];
DateTime raceDate =
DateTime.parse('${item.date} ${item.raceHour}').toLocal();
String formatedRaceDate = DateFormat('HH:mm').format(raceDate);

return Container(
padding: const EdgeInsets.all(2),
height: 80,
height: 84,
color: index % 2 == 1
? Theme.of(context).colorScheme.onSecondary
: Theme.of(context).colorScheme.background,
Expand Down Expand Up @@ -175,7 +180,7 @@ class RaceListItem extends StatelessWidget {
item.country,
),
subtitle: Text(
item.circuitName,
'${item.circuitName}\n${formatedRaceDate}',
),
),
),
Expand Down

0 comments on commit b514efb

Please sign in to comment.