Skip to content

Commit

Permalink
dart format
Browse files Browse the repository at this point in the history
  • Loading branch information
MoralCode committed Mar 8, 2024
1 parent 52f1854 commit 5084573
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 1 addition & 2 deletions lib/src/c2logbook_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ class C2Logbook {
}

Future<http.Response> _patch(String url,
{Map<String, String>? headers,
dynamic body}) async {
{Map<String, String>? headers, dynamic body}) async {
final Map<String, String> allHeaders = <String, String>{}
..addAll(headers ?? <String, String>{})
..addAll(_headers);
Expand Down
11 changes: 7 additions & 4 deletions lib/src/types/c2_type_extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import 'c2_types.dart';
//https://stackoverflow.com/a/44060511/
extension C2PrivacyExtension on C2PrivacyLevel {
static C2PrivacyLevel? fromString(String value) {
return C2PrivacyLevel.values.firstWhere((C2PrivacyLevel e) => e.name == value);
return C2PrivacyLevel.values
.firstWhere((C2PrivacyLevel e) => e.name == value);
}
}

Expand All @@ -16,7 +17,8 @@ extension C2ResultTypeExtension on C2PrivacyLevel {
}

extension C2APIWorkoutTypeExtension on C2APIWorkoutType {
static Map<C2APIWorkoutType, String> _workoutTypes = <C2APIWorkoutType, String>{
static Map<C2APIWorkoutType, String> _workoutTypes =
<C2APIWorkoutType, String>{
C2APIWorkoutType.unknown: 'unknown',
C2APIWorkoutType.JustRow: 'JustRow',
C2APIWorkoutType.FixedDistanceSplits: 'FixedDistanceSplits',
Expand All @@ -35,8 +37,9 @@ extension C2APIWorkoutTypeExtension on C2APIWorkoutType {
}

static C2APIWorkoutType fromString(String value) {
C2APIWorkoutType? type = _workoutTypes.map((C2APIWorkoutType key, String value) =>
MapEntry(value.toUpperCase(), key))[value.toUpperCase()];
C2APIWorkoutType? type = _workoutTypes.map(
(C2APIWorkoutType key, String value) =>
MapEntry(value.toUpperCase(), key))[value.toUpperCase()];
if (type == null) {
throw ArgumentError("value \"$value\" has no matching C2APIWorkoutType");
} else {
Expand Down

0 comments on commit 5084573

Please sign in to comment.