From 20e799986742a3382e5dcfe7fb02ac29e7d3dc65 Mon Sep 17 00:00:00 2001 From: BrightDV <92821484+BrightDV@users.noreply.github.com> Date: Mon, 15 Apr 2024 12:08:51 +0200 Subject: [PATCH] [driver details] fix time missing sometimes --- lib/api/ergast.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/api/ergast.dart b/lib/api/ergast.dart index c446eb2..29341d0 100644 --- a/lib/api/ergast.dart +++ b/lib/api/ergast.dart @@ -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,