Commit e0464948 authored by Administrator's avatar Administrator

cleaning up: getters, setters, unnecssary futures

parent d3c031cf
import 'dart:developer';
import 'dart:io';
import 'package:encrateia/models/power_zone.dart';
import 'package:encrateia/models/strava_fit_download.dart';
// ignore: implementation_imports
import 'package:fit_parser/src/value.dart';
import 'package:flutter/material.dart';
import 'package:encrateia/model/model.dart'
show DbActivity, DbEvent, DbHeartRateZone, DbLap, DbPowerZone;
import 'package:sqfentity_gen/sqfentity_gen.dart';
import 'package:strava_flutter/strava.dart';
import 'package:encrateia/secrets/secrets.dart';
import 'package:strava_flutter/Models/activity.dart' as strava_activity;
import 'package:encrateia/models/athlete.dart';
import 'package:encrateia/models/record_list.dart';
import 'package:encrateia/models/event.dart';
import 'package:encrateia/models/lap.dart';
import 'package:encrateia/models/tag.dart';
import 'package:encrateia/models/power_zone_schema.dart';
import 'package:fit_parser/fit_parser.dart';
import 'package:path_provider/path_provider.dart';
import 'package:encrateia/utils/date_time_utils.dart';
import 'package:intl/intl.dart';
import 'package:encrateia/utils/enums.dart';
import 'package:fit_parser/fit_parser.dart';
// ignore: implementation_imports
import 'package:fit_parser/src/value.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:path_provider/path_provider.dart';
import 'package:sqfentity_gen/sqfentity_gen.dart';
import 'package:strava_flutter/Models/activity.dart' as strava_activity;
import 'package:strava_flutter/strava.dart';
import 'activity_tagging.dart';
import 'athlete.dart';
import 'bar_zone.dart';
import 'event.dart';
import 'heart_rate_zone.dart';
import 'heart_rate_zone_schema.dart';
import 'lap.dart';
import 'power_zone.dart';
import 'power_zone_schema.dart';
import 'record_list.dart';
import 'strava_fit_download.dart';
import 'tag.dart';
class Activity {
Activity();
......@@ -63,77 +65,77 @@ class Activity {
HeartRateZoneSchema _heartRateZoneSchema;
int get id => _db?.id;
String get name => _db.name;
DateTime get startTime => _db.startTime;
int get movingTime => _db.movingTime;
double get avgPower => _db.avgPower;
double get avgSpeed => _db.avgSpeed;
int get avgHeartRate => _db.avgHeartRate;
double get avgFormPower => _db.avgFormPower;
double get avgStrydCadence => _db.avgStrydCadence;
double get avgVerticalOscillation => _db.avgVerticalOscillation;
int get stravaId => _db.stravaId;
int get totalDistance => _db.totalDistance;
DateTime get timeCreated => _db.timeCreated;
double get avgPowerRatio => _db.avgPowerRatio;
double get sdevPowerRatio => _db.sdevPowerRatio;
int get minPower => _db.minPower;
int get maxPower => _db.maxPower;
double get sdevPower => _db.sdevPower;
double get sdevStrydCadence => _db.sdevStrydCadence;
double get sdevFormPower => _db.sdevFormPower;
int get totalCalories => _db.totalCalories;
int get totalAscent => _db.totalAscent;
int get totalDescent => _db.totalDescent;
int get maxHeartRate => _db.maxHeartRate;
double get avgRunningCadence => _db.avgRunningCadence;
int get maxRunningCadence => _db.maxRunningCadence;
int get totalTrainingEffect => _db.totalTrainingEffect;
int get distance => _db.distance;
double get maxSpeed => _db.maxSpeed;
DateTime get timeStamp => _db.timeStamp;
String get event => _db.event;
int get totalStrides => _db.totalStrides;
int get avgTemperature => _db.avgTemperature;
int get maxTemperature => _db.maxTemperature;
double get totalFractionalCycles => _db.totalFractionalCycles;
int get totalElapsedTime => _db.totalElapsedTime;
int get totalTimerTime => _db.totalTimerTime;
int get serialNumber => _db.serialNumber;
String get type => _db.type;
String get eventType => _db.eventType;
String get name => _db.name;
String get sport => _db.sport;
String get state => _db.state;
String get subSport => _db.subSport;
String get eventType => _db.eventType;
String get trigger => _db.trigger;
int get numLaps => _db.numLaps;
int get numSessions => _db.numSessions;
String get type => _db.type;
double get avgFormPower => _db.avgFormPower;
double get avgFractionalCadence => _db.avgFractionalCadence;
double get maxFractionalCadence => _db.maxFractionalCadence;
double get avgGroundTime => _db.avgGroundTime;
double get avgLegSpringStiffness => _db.avgLegSpringStiffness;
double get avgPower => _db.avgPower;
double get avgPowerRatio => _db.avgPowerRatio;
double get avgRunningCadence => _db.avgRunningCadence;
double get avgSpeed => _db.avgSpeed;
double get avgStanceTime => _db.avgStanceTime;
double get avgStanceTimePercent => _db.avgStanceTimePercent;
double get startPositionLong => _db.startPositionLong;
double get startPositionLat => _db.startPositionLat;
double get necLong => _db.necLong;
double get necLat => _db.necLat;
double get swcLong => _db.swcLong;
double get swcLat => _db.swcLat;
double get avgStrideRatio => _db.avgStrideRatio;
String get state => _db.state;
int get athletesId => _db.athletesId;
double get avgLegSpringStiffness => _db.avgLegSpringStiffness;
double get avgStrydCadence => _db.avgStrydCadence;
double get avgVerticalOscillation => _db.avgVerticalOscillation;
double get maxFractionalCadence => _db.maxFractionalCadence;
double get maxSpeed => _db.maxSpeed;
double get minSpeed => _db.minSpeed;
double get necLat => _db.necLat;
double get necLong => _db.necLong;
double get sdevFormPower => _db.sdevFormPower;
double get sdevGroundTime => _db.sdevGroundTime;
double get sdevHeartRate => _db.sdevHeartRate;
double get sdevLegSpringStiffness => _db.sdevLegSpringStiffness;
double get sdevPower => _db.sdevPower;
double get sdevPowerRatio => _db.sdevPowerRatio;
double get sdevSpeed => _db.sdevSpeed;
double get sdevStrideRatio => _db.sdevStrideRatio;
double get avgGroundTime => _db.avgGroundTime;
double get sdevGroundTime => _db.sdevGroundTime;
double get sdevStrydCadence => _db.sdevStrydCadence;
double get sdevVerticalOscillation => _db.sdevVerticalOscillation;
double get sdevHeartRate => _db.sdevHeartRate;
double get startPositionLat => _db.startPositionLat;
double get startPositionLong => _db.startPositionLong;
double get swcLat => _db.swcLat;
double get swcLong => _db.swcLong;
double get totalFractionalCycles => _db.totalFractionalCycles;
int get athletesId => _db.athletesId;
int get avgHeartRate => _db.avgHeartRate;
int get avgTemperature => _db.avgTemperature;
int get distance => _db.distance;
int get maxHeartRate => _db.maxHeartRate;
int get maxPower => _db.maxPower;
int get maxRunningCadence => _db.maxRunningCadence;
int get maxTemperature => _db.maxTemperature;
int get minHeartRate => _db.minHeartRate;
double get sdevSpeed => _db.sdevSpeed;
double get minSpeed => _db.minSpeed;
int get minPower => _db.minPower;
int get movingTime => _db.movingTime;
int get numLaps => _db.numLaps;
int get numSessions => _db.numSessions;
int get serialNumber => _db.serialNumber;
int get stravaId => _db.stravaId;
int get totalAscent => _db.totalAscent;
int get totalCalories => _db.totalCalories;
int get totalDescent => _db.totalDescent;
int get totalDistance => _db.totalDistance;
int get totalElapsedTime => _db.totalElapsedTime;
int get totalStrides => _db.totalStrides;
int get totalTimerTime => _db.totalTimerTime;
int get totalTrainingEffect => _db.totalTrainingEffect;
set maxHeartRate(int value) => _db.maxHeartRate = value;
set name(String value) => _db.name = value;
set state(String value) => _db.state = value;
set maxHeartRate(int value) => _db.maxHeartRate = value;
Future<BoolResult> delete() async => await _db.delete();
Future<int> save() async => await _db.save();
......
......@@ -29,18 +29,18 @@ class Athlete {
int get id => _db?.id;
String get firstName => _db.firstName;
String get geoState => _db.geoState;
String get lastName => _db.lastName;
int get stravaId => _db.stravaId;
String get state => _db.state;
int get recordAggregationCount => _db.recordAggregationCount;
int get downloadInterval => _db.downloadInterval;
String get photoPath => _db.photoPath;
String get state => _db.state;
String get stravaUsername => _db.stravaUsername;
String get geoState => _db.geoState;
int get downloadInterval => _db.downloadInterval;
int get recordAggregationCount => _db.recordAggregationCount;
int get stravaId => _db.stravaId;
set downloadInterval(int value) => _db.downloadInterval = value;
set firstName(String value) => _db.firstName = value;
set lastName(String value) => _db.lastName = value;
set downloadInterval(int value) => _db.downloadInterval = value;
set recordAggregationCount(int value) => _db.recordAggregationCount = value;
@override
......
......@@ -102,19 +102,20 @@ class Event {
int index;
int get id => _db?.id;
String get event => _db.event;
int get power => _db.power;
int get heartRate => _db.heartRate;
double get speed => _db.speed;
DateTime get timeStamp => _db.timeStamp;
String get event => _db.event;
double get distance => _db.distance;
double get groundTime => _db.groundTime;
double get strydCadence => _db.strydCadence;
double get legSpringStiffness => _db.legSpringStiffness;
double get positionLat => _db.positionLat;
double get positionLong => _db.positionLong;
double get speed => _db.speed;
double get strydCadence => _db.strydCadence;
double get verticalOscillation => _db.verticalOscillation;
int get formPower => _db.formPower;
double get distance => _db.distance;
double get positionLong => _db.positionLong;
double get positionLat => _db.positionLat;
int get heartRate => _db.heartRate;
int get power => _db.power;
set event(String value) => _db.event = value;
@override
......
......@@ -31,20 +31,21 @@ class HeartRateZone {
DbHeartRateZone _db;
int get id => _db?.id;
int get color => _db.color;
String get name => _db.name;
int get color => _db.color;
int get lowerLimit => _db.lowerLimit;
int get upperLimit => _db.upperLimit;
int get lowerPercentage => _db.lowerPercentage;
int get upperLimit => _db.upperLimit;
int get upperPercentage => _db.upperPercentage;
set id(int value) => _db.id = value;
set color(int value) => _db.color = value;
set name(String value) => _db.name = value;
set heartRateZoneSchemataId(int value) => _db.heartRateZoneSchemataId = value;
set lowerLimit(int value) => _db.lowerLimit = value;
set upperLimit(int value) => _db.upperLimit = value;
set lowerPercentage(int value) => _db.lowerPercentage = value;
set name(String value) => _db.name = value;
set upperLimit(int value) => _db.upperLimit = value;
set upperPercentage(int value) => _db.upperPercentage = value;
set heartRateZoneSchemataId(int value) => _db.heartRateZoneSchemataId = value;
set id(int value) => _db.id = value;
@override
String toString() => '< HeartRateZone | $name | $lowerLimit >';
......
......@@ -34,13 +34,14 @@ class HeartRateZoneSchema {
DbHeartRateZoneSchema _db;
int get id => _db?.id;
String get name => _db.name;
DateTime get date => _db.date;
String get name => _db.name;
int get base => _db.base;
set name(String value) => _db.name = value;
set id(int value) => _db.id = value;
set base(int value) => _db.base = value;
set date(DateTime value) => _db.date = value;
set id(int value) => _db.id = value;
set name(String value) => _db.name = value;
Future<List<HeartRateZone>> get heartRateZones async {
final List<DbHeartRateZone> dbHeartRateZoneList =
......
......@@ -36,58 +36,58 @@ class Lap {
List<BarZone> heartRateDistributions;
int get id => _db?.id;
int get activitiesId => _db.activitiesId;
int get avgHeartRate => _db.avgHeartRate;
int get totalDistance => _db.totalDistance;
DateTime get startTime => _db.startTime;
DateTime get timeStamp => _db.timeStamp;
String get event => _db.event;
String get eventType => _db.eventType;
String get lapTrigger => _db.lapTrigger;
String get sport => _db.sport;
DateTime get startTime => _db.startTime;
String get subSport => _db.subSport;
String get eventType => _db.eventType;
int get eventGroup => _db.eventGroup;
int get totalElapsedTime => _db.totalElapsedTime;
int get totalTimerTime => _db.totalTimerTime;
double get avgStanceTimePercent => _db.avgStanceTimePercent;
double get avgFormPower => _db.avgFormPower;
double get avgFractionalCadence => _db.avgFractionalCadence;
double get avgGroundTime => _db.avgGroundTime;
double get avgLegSpringStiffness => _db.avgLegSpringStiffness;
double get avgPower => _db.avgPower;
double get avgRunningCadence => _db.avgRunningCadence;
double get avgSpeed => _db.avgSpeed;
double get avgStanceTime => _db.avgStanceTime;
String get lapTrigger => _db.lapTrigger;
double get totalFractionalCycles => _db.totalFractionalCycles;
double get startPositionLong => _db.startPositionLong;
double get startPositionLat => _db.startPositionLat;
double get endPositionLong => _db.endPositionLong;
double get avgStanceTimePercent => _db.avgStanceTimePercent;
double get avgStrydCadence => _db.avgStrydCadence;
double get avgVerticalOscillation => _db.avgVerticalOscillation;
double get endPositionLat => _db.endPositionLat;
int get intensity => _db.intensity;
double get avgSpeed => _db.avgSpeed;
double get endPositionLong => _db.endPositionLong;
double get maxFractionalCadence => _db.maxFractionalCadence;
double get maxSpeed => _db.maxSpeed;
int get totalCalories => _db.totalCalories;
int get totalAscent => _db.totalAscent;
int get totalDescent => _db.totalDescent;
double get avgRunningCadence => _db.avgRunningCadence;
int get totalStrides => _db.totalStrides;
DateTime get timeStamp => _db.timeStamp;
double get minSpeed => _db.minSpeed;
double get sdevFormPower => _db.sdevFormPower;
double get sdevGroundTime => _db.sdevGroundTime;
double get sdevHeartRate => _db.sdevHeartRate;
double get sdevLegSpringStiffness => _db.sdevLegSpringStiffness;
double get sdevPower => _db.sdevPower;
double get sdevSpeed => _db.sdevSpeed;
double get sdevStrydCadence => _db.sdevStrydCadence;
double get sdevVerticalOscillation => _db.sdevVerticalOscillation;
double get startPositionLat => _db.startPositionLat;
double get startPositionLong => _db.startPositionLong;
double get totalFractionalCycles => _db.totalFractionalCycles;
int get activitiesId => _db.activitiesId;
int get avgHeartRate => _db.avgHeartRate;
int get avgTemperature => _db.avgTemperature;
int get maxTemperature => _db.maxTemperature;
double get avgFractionalCadence => _db.avgFractionalCadence;
double get maxFractionalCadence => _db.maxFractionalCadence;
int get eventGroup => _db.eventGroup;
int get intensity => _db.intensity;
int get maxHeartRate => _db.maxHeartRate;
double get avgPower => _db.avgPower;
double get avgVerticalOscillation => _db.avgVerticalOscillation;
int get maxPower => _db.maxPower;
int get maxRunningCadence => _db.maxRunningCadence;
double get avgGroundTime => _db.avgGroundTime;
double get avgStrydCadence => _db.avgStrydCadence;
double get avgLegSpringStiffness => _db.avgLegSpringStiffness;
double get avgFormPower => _db.avgFormPower;
double get sdevHeartRate => _db.sdevHeartRate;
int get maxTemperature => _db.maxTemperature;
int get minHeartRate => _db.minHeartRate;
double get sdevSpeed => _db.sdevSpeed;
double get minSpeed => _db.minSpeed;
double get sdevFormPower => _db.sdevFormPower;
double get sdevPower => _db.sdevPower;
int get minPower => _db.minPower;
int get maxPower => _db.maxPower;
double get sdevGroundTime => _db.sdevGroundTime;
double get sdevVerticalOscillation => _db.sdevVerticalOscillation;
double get sdevStrydCadence => _db.sdevStrydCadence;
double get sdevLegSpringStiffness => _db.sdevLegSpringStiffness;
int get totalAscent => _db.totalAscent;
int get totalCalories => _db.totalCalories;
int get totalDescent => _db.totalDescent;
int get totalDistance => _db.totalDistance;
int get totalElapsedTime => _db.totalElapsedTime;
int get totalStrides => _db.totalStrides;
int get totalTimerTime => _db.totalTimerTime;
Future<BoolResult> delete() async => await _db.delete();
Future<int> save() async => await _db.save();
......
......@@ -28,24 +28,24 @@ class PowerZone {
}
PowerZone._fromDb(this._db);
DbPowerZone _db;
int get id => _db?.id;
int get color => _db.color;
String get name => _db.name;
int get color => _db.color;
int get lowerLimit => _db.lowerLimit;
int get upperLimit => _db.upperLimit;
int get lowerPercentage => _db.lowerPercentage;
int get upperLimit => _db.upperLimit;
int get upperPercentage => _db.upperPercentage;
set id(int value) => _db.id = value;
set color(int value) => _db.color = value;
set name(String value) => _db.name = value;
set lowerLimit(int value) => _db.lowerLimit = value;
set upperLimit(int value) => _db.upperLimit = value;
set lowerPercentage(int value) => _db.lowerPercentage = value;
set upperPercentage(int value) => _db.upperPercentage = value;
set name(String value) => _db.name = value;
set powerZoneSchemataId(int value) => _db.powerZoneSchemataId = value;
set id(int value) => _db.id = value;
set upperLimit(int value) => _db.upperLimit = value;
set upperPercentage(int value) => _db.upperPercentage = value;
@override
String toString() => '< PowerZone | $name | $lowerLimit >';
......
......@@ -42,13 +42,14 @@ class PowerZoneSchema {
DbPowerZoneSchema _db;
int get id => _db?.id;
String get name => _db.name;
DateTime get date => _db.date;
String get name => _db.name;
int get base => _db.base;
set name(String value) => _db.name = value;
set id(int value) => _db.id = value;
set base(int value) => _db.base = value;
set date(DateTime value) => _db.date = value;
set id(int value) => _db.id = value;
set name(String value) => _db.name = value;
Future<BoolResult> delete() async => await _db.delete();
Future<int> save() async => await _db.save();
......
......@@ -25,9 +25,10 @@ class Tag {
bool selected = false;
int get id => _db?.id;
int get color => _db.color;
String get name => _db.name;
bool get system => _db.system;
int get color => _db.color;
set color(int value) => _db.color = value;
set name(String value) => _db.name = value;
......
......@@ -35,9 +35,10 @@ class TagGroup {
List<Tag> cachedTags;
int get id => _db?.id;
int get color => _db.color;
String get name => _db.name;
bool get system => _db.system;
int get color => _db.color;
set color(int value) => _db.color = value;
set name(String value) => _db.name = value;
......
......@@ -17,6 +17,7 @@ class Weight {
int get id => _db?.id;
DateTime get date => _db.date;
double get value => _db.value;
set date(DateTime value) => _db.date = value;
set value(double value) => _db.value = value;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment