Merge pull request #329 from Oloodi/324-chore-add-total-number-of-shifts-as-a-count-in-the-coverage-page-next-to-the-title-shifts
324 chore add total number of shifts as a count in the coverage page next to the title shifts
This commit is contained in:
@@ -39,7 +39,7 @@ class CoverageShift extends Equatable {
|
|||||||
|
|
||||||
/// Calculates the coverage percentage for this shift.
|
/// Calculates the coverage percentage for this shift.
|
||||||
int get coveragePercent {
|
int get coveragePercent {
|
||||||
if (workersNeeded == 0) return 100;
|
if (workersNeeded == 0) return 0;
|
||||||
return ((workers.length / workersNeeded) * 100).round();
|
return ((workers.length / workersNeeded) * 100).round();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ class CoverageStats extends Equatable {
|
|||||||
|
|
||||||
/// Calculates the overall coverage percentage.
|
/// Calculates the overall coverage percentage.
|
||||||
int get coveragePercent {
|
int get coveragePercent {
|
||||||
if (totalNeeded == 0) return 100;
|
if (totalNeeded == 0) return 0;
|
||||||
return ((totalConfirmed / totalNeeded) * 100).round();
|
return ((totalConfirmed / totalNeeded) * 100).round();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class CoveragePage extends StatelessWidget {
|
|||||||
const SizedBox(height: UiConstants.space5),
|
const SizedBox(height: UiConstants.space5),
|
||||||
],
|
],
|
||||||
Text(
|
Text(
|
||||||
'Shifts',
|
'Shifts (${state.shifts.length})',
|
||||||
style: UiTypography.title2b.copyWith(
|
style: UiTypography.title2b.copyWith(
|
||||||
color: UiColors.textPrimary,
|
color: UiColors.textPrimary,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user