A calculator for calculating burned calories during hiking that depends on the weight of the person, weight of the pack, type of the terrain and hiking speed. This calculation is based on the famous Pandolf Equation
In the pubspec.yaml
of your flutter project, add the following dependency:
dependencies:
...
hiking_calories_calculator: "^0.0.1"
CaloriesCalculator
class has static method calculateCalories
that can be called to calculate calories.
Calculation calculation = CaloriesCalculator.calculateCalories(
weight: Weight(lbs: 120),
bagWeight: Weight(lbs: 20),
speed: Speed(mph: 4),
terrain: Terrains.WET_CLAY_OR_ICE,
inclination: 0);
print("\nCalories per Hour:");
print(calculation.kcalPerHour.ceil().toString());
print("\nCalories per Mile:");
print(calculation.kcalPerMile.ceil().toString());
No | Terrain Type | Terrain Factor | Accessible code |
---|---|---|---|
1 | Paved Road | 1.0 | Terrains.PAVED_ROAD |
2 | Gravel Road | 1.2 | Terrains.GRAVEL_ROAD |
3 | Wet Clay/Ice | 1.7 | Terrains.WET_CLAY_OR_ICE |
4 | Sand | 2.0 | Terrains.SAND |
5 | Swamp | 3.5 | Terrains.SWAMP |