Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored and simplified file structure and added data models for in… #8

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e2d321a
Update c2logbook.dart
pfredCL Mar 7, 2024
146463a
Merge pull request #1 from OpenRowingCommunity/main
pfredCL Mar 11, 2024
2f8c3b5
We need these
pfredCL Mar 11, 2024
76303b6
Biiiiig refactor
pfredCL Mar 11, 2024
13aa69e
Anotha one
pfredCL Mar 12, 2024
54e9bf8
Parsing support added for full c2 results
pfredCL Mar 12, 2024
3559304
Added rest time
pfredCL Mar 12, 2024
e31c402
Fixed some errors that occur on docker compose up in crewlab
pfredCL Mar 12, 2024
5c2b68f
Fixed some errors that occur on docker compose up in crewlab
pfredCL Mar 12, 2024
9da62a4
I swear I fixed this wtf
pfredCL Mar 12, 2024
6f0787b
More tweaking of models
pfredCL Mar 12, 2024
1594270
More tweaking of models
pfredCL Mar 12, 2024
f2ecf3c
More tweaking of models
pfredCL Mar 12, 2024
8177406
More tweaking of models
pfredCL Mar 12, 2024
4aa321c
Re-added json keys
pfredCL Mar 12, 2024
b9b4eba
More model alterations
pfredCL Mar 12, 2024
a26ca1a
Alright no more mr nice guy
pfredCL Mar 12, 2024
81f1731
Alright no more mr nice guy
pfredCL Mar 12, 2024
ea413e0
Alright no more mr nice guy
pfredCL Mar 12, 2024
9c93cb5
Alright no more mr nice guy
pfredCL Mar 12, 2024
6371c93
Alright no more mr nice guy
pfredCL Mar 12, 2024
a6a124a
Alright no more mr nice guy
pfredCL Mar 12, 2024
8c437a3
Alright no more mr nice guy
pfredCL Mar 12, 2024
847a587
Alright no more mr nice guy
pfredCL Mar 12, 2024
81820c0
Alright no more mr nice guy
pfredCL Mar 12, 2024
8acef32
Refactored and simplified file structure and added data models for in…
pfredCL Mar 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added rest time
pfredCL committed Mar 12, 2024
commit 3559304d3daefd1f220f0d661b234d98e73c9822
1 change: 1 addition & 0 deletions lib/src/types/c2_full_results.dart
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ class C2FullResults with _$C2FullResults {
@Default(0) int distance,
@Default(C2ResultType.rower) C2ResultType type,
@DecimalIntConverter.tenths() required double time,
@DecimalIntConverter.tenths() required double restTime,
@Default(C2APIWorkoutType.JustRow)
C2APIWorkoutType workoutType,
@Default("c2logbook dart") String source,
27 changes: 26 additions & 1 deletion lib/src/types/index.freezed.dart
Original file line number Diff line number Diff line change
@@ -31,6 +31,8 @@ mixin _$C2FullResults {
C2ResultType get type => throw _privateConstructorUsedError;
@DecimalIntConverter.tenths()
double get time => throw _privateConstructorUsedError;
@DecimalIntConverter.tenths()
double get restTime => throw _privateConstructorUsedError;
C2APIWorkoutType get workoutType => throw _privateConstructorUsedError;
String get source => throw _privateConstructorUsedError;
C2WeightClass get weightClass => throw _privateConstructorUsedError;
@@ -64,6 +66,7 @@ abstract class $C2FullResultsCopyWith<$Res> {
int distance,
C2ResultType type,
@DecimalIntConverter.tenths() double time,
@DecimalIntConverter.tenths() double restTime,
C2APIWorkoutType workoutType,
String source,
C2WeightClass weightClass,
@@ -100,6 +103,7 @@ class _$C2FullResultsCopyWithImpl<$Res, $Val extends C2FullResults>
Object? distance = null,
Object? type = null,
Object? time = null,
Object? restTime = null,
Object? workoutType = null,
Object? source = null,
Object? weightClass = null,
@@ -145,6 +149,10 @@ class _$C2FullResultsCopyWithImpl<$Res, $Val extends C2FullResults>
? _value.time
: time // ignore: cast_nullable_to_non_nullable
as double,
restTime: null == restTime
? _value.restTime
: restTime // ignore: cast_nullable_to_non_nullable
as double,
workoutType: null == workoutType
? _value.workoutType
: workoutType // ignore: cast_nullable_to_non_nullable
@@ -218,6 +226,7 @@ abstract class _$$C2FullResultsImplCopyWith<$Res>
int distance,
C2ResultType type,
@DecimalIntConverter.tenths() double time,
@DecimalIntConverter.tenths() double restTime,
C2APIWorkoutType workoutType,
String source,
C2WeightClass weightClass,
@@ -253,6 +262,7 @@ class __$$C2FullResultsImplCopyWithImpl<$Res>
Object? distance = null,
Object? type = null,
Object? time = null,
Object? restTime = null,
Object? workoutType = null,
Object? source = null,
Object? weightClass = null,
@@ -298,6 +308,10 @@ class __$$C2FullResultsImplCopyWithImpl<$Res>
? _value.time
: time // ignore: cast_nullable_to_non_nullable
as double,
restTime: null == restTime
? _value.restTime
: restTime // ignore: cast_nullable_to_non_nullable
as double,
workoutType: null == workoutType
? _value.workoutType
: workoutType // ignore: cast_nullable_to_non_nullable
@@ -358,6 +372,7 @@ class _$C2FullResultsImpl extends _C2FullResults {
this.distance = 0,
this.type = C2ResultType.rower,
@DecimalIntConverter.tenths() required this.time,
@DecimalIntConverter.tenths() required this.restTime,
this.workoutType = C2APIWorkoutType.JustRow,
this.source = "c2logbook dart",
this.weightClass = C2WeightClass.heavyweight,
@@ -400,6 +415,9 @@ class _$C2FullResultsImpl extends _C2FullResults {
@DecimalIntConverter.tenths()
final double time;
@override
@DecimalIntConverter.tenths()
final double restTime;
@override
@JsonKey()
final C2APIWorkoutType workoutType;
@override
@@ -445,7 +463,7 @@ class _$C2FullResultsImpl extends _C2FullResults {

@override
String toString() {
return 'C2FullResults(id: $id, userId: $userId, endDate: $endDate, dateUtc: $dateUtc, timezone: $timezone, distance: $distance, type: $type, time: $time, workoutType: $workoutType, source: $source, weightClass: $weightClass, strokeRate: $strokeRate, verified: $verified, ranked: $ranked, comments: $comments, privacy: $privacy, intervals: $intervals, splits: $splits, heartRate: $heartRate)';
return 'C2FullResults(id: $id, userId: $userId, endDate: $endDate, dateUtc: $dateUtc, timezone: $timezone, distance: $distance, type: $type, time: $time, restTime: $restTime, workoutType: $workoutType, source: $source, weightClass: $weightClass, strokeRate: $strokeRate, verified: $verified, ranked: $ranked, comments: $comments, privacy: $privacy, intervals: $intervals, splits: $splits, heartRate: $heartRate)';
}

@override
@@ -463,6 +481,8 @@ class _$C2FullResultsImpl extends _C2FullResults {
other.distance == distance) &&
(identical(other.type, type) || other.type == type) &&
(identical(other.time, time) || other.time == time) &&
(identical(other.restTime, restTime) ||
other.restTime == restTime) &&
(identical(other.workoutType, workoutType) ||
other.workoutType == workoutType) &&
(identical(other.source, source) || other.source == source) &&
@@ -495,6 +515,7 @@ class _$C2FullResultsImpl extends _C2FullResults {
distance,
type,
time,
restTime,
workoutType,
source,
weightClass,
@@ -532,6 +553,7 @@ abstract class _C2FullResults extends C2FullResults {
final int distance,
final C2ResultType type,
@DecimalIntConverter.tenths() required final double time,
@DecimalIntConverter.tenths() required final double restTime,
final C2APIWorkoutType workoutType,
final String source,
final C2WeightClass weightClass,
@@ -568,6 +590,9 @@ abstract class _C2FullResults extends C2FullResults {
@DecimalIntConverter.tenths()
double get time;
@override
@DecimalIntConverter.tenths()
double get restTime;
@override
C2APIWorkoutType get workoutType;
@override
String get source;
3 changes: 3 additions & 0 deletions lib/src/types/index.g.dart

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

2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: c2logbook
description: A Dart wrapper providing an Object-Oriented interface to the Concept2 Logbook API
version: 0.0.3
version: 0.0.4
# repository: https://github.com/my_org/my_repo

environment: