Skip to content

Commit

Permalink
[driver details] fix time missing sometimes
Browse files Browse the repository at this point in the history
  • Loading branch information
BrightDV committed Apr 15, 2024
1 parent de31882 commit 20e7999
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/api/ergast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,10 @@ class _ErgastApiCalls {
race['Results'][0]['Driver']['familyName'],
race['Results'][0]['Driver']['code'],
race['Results'][0]['Constructor']['constructorId'],
race['Results'][0]['Time']?['time'] ?? 'DNF',
race['Results'][0]['positionText'] == 'R'
? 'DNF'
: race['Results'][0]['Time']?['time'] ??
race['Results'][0]['status'],
int.parse(race['Results'][0]['FastestLap']?['rank'] ?? '20') == 1
? true
: false,
Expand Down

0 comments on commit 20e7999

Please sign in to comment.