Run class Null safety
Run Model
- Inheritance
- Implemented types
- Annotations
- @DataClass()
- @JsonSerializable()
- @ConnectOfflineFirstWithRest(restConfig: const RestSerializable(endpoint: '=> SyncEndpointHelper.getConfiguration("runs", query, instance)'))
Constructors
-
Run({required String id, required bool isRaceDay, num distance = 0, double averageSpeed = 0, String userId = '', RunState state = RunState.running, Map<
String, dynamic> meta = const {}, num? timezoneOffset, String? end, Json? deviceInformations, String? eventId, String? created}) - Run.empty({String id = '', String userId = '', bool isRaceDay = false, Json? deviceInformations})
Properties
- averageSpeed → double
-
The average speed in km/h the user was running
final
- created → String
-
The actual start time when the user created the run on his device
including a full ISO 8601-Datetime
final
- deviceInformations → Json
-
Containing device information
@Sqlite(toGenerator: 'SyncGeneratorHelper.mapToSql(%INSTANCE_PROPERTY%)'), final
- distance → num
-
The distance the user has travelled during that run
final
- end → String?
-
The end time when the user finished the run on his device
represented as full ISO 8601-Datetime
final
- eventId → String
-
Which event does this run belong to
final
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- id → String
-
Run id
@Sqlite(index: true, unique: true), final
- isNewRecord → bool
-
If
true
, this model has not yet been inserted into SQLite.read-only, inherited - isRaceDay → bool
-
Indicating whether the run is a demo or a Race Day Run
final
-
meta
→ Map<
String, dynamic> -
Can contain additional entries as meta-data to implement
project-specific use cases.
@Sqlite(toGenerator: 'SyncGeneratorHelper.mapToSql(%INSTANCE_PROPERTY%)'), final
- primaryKey ↔ int?
-
The fields needs to be overwritten, to keep it out of the json
@JsonKey(ignore: true), read / write, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- state → RunState
-
The state of the run indicating in what part of the workflow
the run is currently at
@Rest(enumAsString: true, fromGenerator: 'SyncGeneratorHelper.enumFromSqlOrRest<RunState>(RunState.values, %DATA_PROPERTY%, RunState.unknown)', toGenerator: 'SyncGeneratorHelper.enumToSqlOrRest<RunState>(%INSTANCE_PROPERTY%)'), @Sqlite(columnType: Column.varchar, fromGenerator: 'SyncGeneratorHelper.enumFromSqlOrRest<RunState>(RunState.values, %DATA_PROPERTY%, RunState.unknown)', toGenerator: 'SyncGeneratorHelper.enumToSqlOrRest<RunState>(%INSTANCE_PROPERTY%)'), final
- timezoneOffset → num?
-
The Timezone Offset of the users local time in minutes.
final
- userId → String
-
The user to which this run belongs
Keep in mind: This property is not part of any Request Payload at all.
It is provided via the Authorization-Header.
@Rest(ignore: true), final
Methods
-
afterSave(
{Provider< Model> ? provider, ModelRepository<Model> ? repository}) → Future<void> -
Hook invoked after the model is successfully entered in the SQLite database.
Useful to update or save associations.
inherited
-
beforeSave(
{Provider< Model> ? provider, ModelRepository<Model> ? repository}) → Future<void> -
Hook invoked before the model is successfully entered in the SQLite database.
Useful to update or save associations.
inherited
-
copyWith(
{String? id, bool? isRaceDay, num? distance, double? averageSpeed, String? userId, RunState? state, Map< String, dynamic> ? meta, num? timezoneOffset, String? end, Map<String, dynamic> ? deviceInformations, String? eventId, String? created}) → Run -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toJson(
) → Map< String, dynamic> -
Json representation
override
-
toString(
) → String -
A string representation of this object. [...]
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited