Skip to content

Commit

Permalink
Combine some types for consistency across iOS and Android
Browse files Browse the repository at this point in the history
  • Loading branch information
SlimShadyIAm committed Aug 12, 2024
1 parent 3979573 commit 3ba6222
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 102 deletions.
190 changes: 95 additions & 95 deletions packages/health/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2199,10 +2199,13 @@ class HealthPlugin(private var channel: MethodChannel? = null) :
"CALISTHENICS" to
ExerciseSessionRecord
.EXERCISE_TYPE_CALISTHENICS,
"CARDIO_DANCE" to
ExerciseSessionRecord
.EXERCISE_TYPE_DANCING,
"CRICKET" to ExerciseSessionRecord.EXERCISE_TYPE_CRICKET,
// "CROSS_COUNTRY_SKIING" to ExerciseSessionRecord.EXERCISE_TYPE_SKIING_CROSS_COUNTRY,
"CROSS_COUNTRY_SKIING" to ExerciseSessionRecord.EXERCISE_TYPE_SKIING,
"DANCING" to ExerciseSessionRecord.EXERCISE_TYPE_DANCING,
// "DOWNHILL_SKIING" to ExerciseSessionRecord.EXERCISE_TYPE_SKIING_DOWNHILL,
"DOWNHILL_SKIING" to ExerciseSessionRecord.EXERCISE_TYPE_SKIING,
"ELLIPTICAL" to
ExerciseSessionRecord
.EXERCISE_TYPE_ELLIPTICAL,
Expand Down Expand Up @@ -2261,6 +2264,9 @@ class HealthPlugin(private var channel: MethodChannel? = null) :
ExerciseSessionRecord
.EXERCISE_TYPE_SNOWSHOEING,
// "SOCCER" to ExerciseSessionRecord.EXERCISE_TYPE_FOOTBALL_SOCCER,
"SOCIAL_DANCE" to
ExerciseSessionRecord
.EXERCISE_TYPE_DANCING,
"SOFTBALL" to ExerciseSessionRecord.EXERCISE_TYPE_SOFTBALL,
"SQUASH" to ExerciseSessionRecord.EXERCISE_TYPE_SQUASH,
"STAIR_CLIMBING_MACHINE" to
Expand Down Expand Up @@ -2296,6 +2302,12 @@ class HealthPlugin(private var channel: MethodChannel? = null) :
"WHEELCHAIR" to
ExerciseSessionRecord
.EXERCISE_TYPE_WHEELCHAIR,
"WHEELCHAIR_RUN_PACE" to
ExerciseSessionRecord
.EXERCISE_TYPE_WHEELCHAIR,
"WHEELCHAIR_WALK_PACE" to
ExerciseSessionRecord
.EXERCISE_TYPE_WHEELCHAIR,
"YOGA" to ExerciseSessionRecord.EXERCISE_TYPE_YOGA,
"OTHER" to ExerciseSessionRecord.EXERCISE_TYPE_OTHER_WORKOUT,
)
Expand Down
4 changes: 3 additions & 1 deletion packages/health/ios/Classes/SwiftHealthPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1339,8 +1339,10 @@ public class SwiftHealthPlugin: NSObject, FlutterPlugin {
workoutActivityTypeMap["PADDLE_SPORTS"] = .paddleSports
workoutActivityTypeMap["ROWING"] = .rowing
workoutActivityTypeMap["SAILING"] = .sailing
workoutActivityTypeMap["SURFING_SPORTS"] = .surfingSports
workoutActivityTypeMap["SURFING"] = .surfingSports
workoutActivityTypeMap["SWIMMING"] = .swimming
workoutActivityTypeMap["SWIMMING_OPEN_WATER"] = .swimming
workoutActivityTypeMap["SWIMMING_POOL"] = .swimming
workoutActivityTypeMap["WATER_FITNESS"] = .waterFitness
workoutActivityTypeMap["WATER_POLO"] = .waterPolo
workoutActivityTypeMap["WATER_SPORTS"] = .waterSports
Expand Down
1 change: 0 additions & 1 deletion packages/health/lib/health.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion packages/health/lib/src/health_plugin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ class Health {
HealthWorkoutActivityType.STAIR_CLIMBING,
HealthWorkoutActivityType.STAIRS,
HealthWorkoutActivityType.STEP_TRAINING,
HealthWorkoutActivityType.SURFING_SPORTS,
HealthWorkoutActivityType.SURFING,
HealthWorkoutActivityType.SWIMMING,
HealthWorkoutActivityType.TABLE_TENNIS,
HealthWorkoutActivityType.TAI_CHI,
Expand All @@ -1135,6 +1135,8 @@ class Health {
HealthWorkoutActivityType.WHEELCHAIR_WALK_PACE,
HealthWorkoutActivityType.WRESTLING,
HealthWorkoutActivityType.YOGA,
HealthWorkoutActivityType.SWIMMING_OPEN_WATER,
HealthWorkoutActivityType.SWIMMING_POOL,
}.contains(type);
}

Expand All @@ -1151,6 +1153,7 @@ class Health {
HealthWorkoutActivityType.BASKETBALL,
HealthWorkoutActivityType.BIKING,
HealthWorkoutActivityType.BOXING,
HealthWorkoutActivityType.CARDIO_DANCE,
HealthWorkoutActivityType.CRICKET,
HealthWorkoutActivityType.CROSS_COUNTRY_SKIING,
HealthWorkoutActivityType.CURLING,
Expand All @@ -1173,6 +1176,7 @@ class Health {
HealthWorkoutActivityType.SKATING,
HealthWorkoutActivityType.SNOWBOARDING,
HealthWorkoutActivityType.SOCCER,
HealthWorkoutActivityType.SOCIAL_DANCE,
HealthWorkoutActivityType.SOFTBALL,
HealthWorkoutActivityType.SQUASH,
HealthWorkoutActivityType.STAIR_CLIMBING,
Expand All @@ -1181,6 +1185,8 @@ class Health {
HealthWorkoutActivityType.VOLLEYBALL,
HealthWorkoutActivityType.WALKING,
HealthWorkoutActivityType.WATER_POLO,
HealthWorkoutActivityType.WHEELCHAIR_RUN_PACE,
HealthWorkoutActivityType.WHEELCHAIR_WALK_PACE,
HealthWorkoutActivityType.YOGA,

// Android only
Expand Down
3 changes: 1 addition & 2 deletions packages/health/lib/src/heath_data_types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ enum HealthWorkoutActivityType {
SOCIAL_DANCE,
STAIRS,
STEP_TRAINING,
SURFING_SPORTS,
SURFING,
TAI_CHI,
TRACK_AND_FIELD,
TRADITIONAL_STRENGTH_TRAINING,
Expand Down Expand Up @@ -549,7 +549,6 @@ enum HealthWorkoutActivityType {
SNOWSHOEING,
STAIR_CLIMBING_MACHINE,
STRENGTH_TRAINING,
SURFING,
SWIMMING_OPEN_WATER,
SWIMMING_POOL,
WALKING_FITNESS,
Expand Down

0 comments on commit 3ba6222

Please sign in to comment.