progressPercent property

int get progressPercent

The startup progress as a percentage (0–100).

When subTaskFraction is non-null (the active task is reporting intra-task progress) it is used directly so the splash bar advances continuously. Otherwise the percentage is derived from completedCount / totalCount.

Returns 0 when totalCount is zero to avoid a division-by-zero. Result is clamped to [0, 100] to guard against invalid inputs.

Implementation

int get progressPercent {
  if (totalCount <= 0) return 0;
  if (subTaskFraction != null) return (subTaskFraction! * 100).round().clamp(0, 100);
  assert(completedCount <= totalCount, 'completedCount ($completedCount) exceeded totalCount ($totalCount)');
  return ((completedCount / totalCount) * 100).round().clamp(0, 100);
}