diff --git a/lib/Services/downloadConfiguration.dart b/lib/Services/downloadConfiguration.dart index 1ac90cd..03bf47f 100644 --- a/lib/Services/downloadConfiguration.dart +++ b/lib/Services/downloadConfiguration.dart @@ -272,15 +272,18 @@ class _DownloadConfigurationWidgetState extends State( valueListenable: currentResourceIndex, builder: (context, valueIndex, _) { + var valueInPercentage = valueNbr > 0 ? (valueIndex / valueNbr) * 100 : 100; + String formattedPercentage = valueInPercentage.toStringAsFixed(0); // Limite à 2 décimales + return valueNbr != -1 && valueNbr != 0 ? Center( child: Padding( padding: const EdgeInsets.only(bottom: 8.0), child: Text( - "${valueIndex.toString()}/${valueNbr.toString()}", - style: TextStyle(fontSize: 45, fontWeight: FontWeight.w500), + '$formattedPercentage%', + style: const TextStyle(fontSize: 45, fontWeight: FontWeight.w500), ), ), - ) : SizedBox(height: 0,width: 0); + ) : const SizedBox(height: 0,width: 0); } ); }