Commit 518f2f15 authored by Administrator's avatar Administrator

fix the getChildren() for parent.id == null bug with if-conditions

parent 2d3369c2
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_secure_storage","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"path_provider","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.8/","dependencies":[]},{"name":"shared_preferences","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+2/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"uni_links","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/","dependencies":[]}],"android":[{"name":"flutter_secure_storage","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"path_provider","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.8/","dependencies":[]},{"name":"shared_preferences","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+2/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"uni_links","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+2/","dependencies":[]},{"name":"shared_preferences_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+8/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"url_launcher_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+5/","dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"shared_preferences_web","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+5/","dependencies":[]},{"name":"url_launcher_web","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-0.1.1+5/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_secure_storage","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos"]},{"name":"path_provider_macos","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"sqflite","dependencies":[]},{"name":"uni_links","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_web","url_launcher_macos"]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]}],"date_created":"2020-05-15 19:03:35.227067","version":"1.17.1"} {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_secure_storage","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"path_provider","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.8/","dependencies":[]},{"name":"shared_preferences","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+2/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"uni_links","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/","dependencies":[]}],"android":[{"name":"flutter_secure_storage","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.3/","dependencies":[]},{"name":"path_provider","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.8/","dependencies":[]},{"name":"shared_preferences","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+2/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"uni_links","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/uni_links-0.4.0/","dependencies":[]},{"name":"url_launcher","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-5.4.7/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+2/","dependencies":[]},{"name":"shared_preferences_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+8/","dependencies":[]},{"name":"sqflite","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0+1/","dependencies":[]},{"name":"url_launcher_macos","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-0.0.1+5/","dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"shared_preferences_web","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+5/","dependencies":[]},{"name":"url_launcher_web","path":"/home/stefan/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-0.1.1+5/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_secure_storage","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos"]},{"name":"path_provider_macos","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"sqflite","dependencies":[]},{"name":"uni_links","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_web","url_launcher_macos"]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]}],"date_created":"2020-05-15 19:45:41.979156","version":"1.17.1"}
\ No newline at end of file \ No newline at end of file
This diff is collapsed.
...@@ -7,12 +7,12 @@ class HeartRateZone extends ChangeNotifier { ...@@ -7,12 +7,12 @@ class HeartRateZone extends ChangeNotifier {
HeartRateZone( HeartRateZone(
{@required HeartRateZoneSchema heartRateZoneSchema, {@required HeartRateZoneSchema heartRateZoneSchema,
String name, String name,
int lowerPercentage, int lowerPercentage,
int upperPercentage, int upperPercentage,
int lowerLimit, int lowerLimit,
int upperLimit, int upperLimit,
int color}) { int color}) {
db = DbHeartRateZone() db = DbHeartRateZone()
..heartRateZoneSchemataId = heartRateZoneSchema.db.id ..heartRateZoneSchemataId = heartRateZoneSchema.db.id
..name = name ?? "My Zone" ..name = name ?? "My Zone"
...@@ -23,9 +23,11 @@ class HeartRateZone extends ChangeNotifier { ...@@ -23,9 +23,11 @@ class HeartRateZone extends ChangeNotifier {
..color = color ?? 0xFFFFc107; ..color = color ?? 0xFFFFc107;
if (lowerPercentage != null) if (lowerPercentage != null)
db.lowerLimit = (lowerPercentage * heartRateZoneSchema.db.base / 100).round(); db.lowerLimit =
(lowerPercentage * heartRateZoneSchema.db.base / 100).round();
if (upperPercentage != null) if (upperPercentage != null)
db.upperLimit = (upperPercentage * heartRateZoneSchema.db.base / 100).round(); db.upperLimit =
(upperPercentage * heartRateZoneSchema.db.base / 100).round();
} }
HeartRateZone.fromDb(this.db); HeartRateZone.fromDb(this.db);
...@@ -37,13 +39,16 @@ class HeartRateZone extends ChangeNotifier { ...@@ -37,13 +39,16 @@ class HeartRateZone extends ChangeNotifier {
static Future<List<HeartRateZone>> all( static Future<List<HeartRateZone>> all(
{@required HeartRateZoneSchema heartRateZoneSchema}) async { {@required HeartRateZoneSchema heartRateZoneSchema}) async {
var dbHeartRateZoneList = await heartRateZoneSchema.db if (heartRateZoneSchema.db.id != null) {
.getDbHeartRateZones() var dbHeartRateZoneList = await heartRateZoneSchema.db
.orderByDesc('lowerlimit') .getDbHeartRateZones()
.toList(); .orderByDesc('lowerlimit')
var heartRateZones = dbHeartRateZoneList .toList();
.map((dbHeartRateZone) => HeartRateZone.fromDb(dbHeartRateZone)) var heartRateZones = dbHeartRateZoneList
.toList(); .map((dbHeartRateZone) => HeartRateZone.fromDb(dbHeartRateZone))
return heartRateZones; .toList();
return heartRateZones;
} else
return [];
} }
} }
...@@ -37,13 +37,16 @@ class PowerZone extends ChangeNotifier { ...@@ -37,13 +37,16 @@ class PowerZone extends ChangeNotifier {
static Future<List<PowerZone>> all( static Future<List<PowerZone>> all(
{@required PowerZoneSchema powerZoneSchema}) async { {@required PowerZoneSchema powerZoneSchema}) async {
var dbPowerZoneList = await powerZoneSchema.db if (powerZoneSchema.db.id != null) {
.getDbPowerZones() var dbPowerZoneList = await powerZoneSchema.db
.orderByDesc('lowerlimit') .getDbPowerZones()
.toList(); .orderByDesc('lowerlimit')
var powerZones = dbPowerZoneList .toList();
.map((dbPowerZone) => PowerZone.fromDb(dbPowerZone)) var powerZones = dbPowerZoneList
.toList(); .map((dbPowerZone) => PowerZone.fromDb(dbPowerZone))
return powerZones; .toList();
return powerZones;
} else
return [];
} }
} }
...@@ -25,10 +25,11 @@ class Tag extends ChangeNotifier { ...@@ -25,10 +25,11 @@ class Tag extends ChangeNotifier {
} }
static Future<List<Tag>> all({@required TagGroup tagGroup}) async { static Future<List<Tag>> all({@required TagGroup tagGroup}) async {
print(tagGroup.db.id); if (tagGroup.db.id != null) {
var dbTagList = await tagGroup.db.getDbTags().orderBy('name').toList(); var dbTagList = await tagGroup.db.getDbTags().orderBy('name').toList();
print(dbTagList.length); var tags = dbTagList.map((dbTag) => Tag.fromDb(dbTag)).toList();
var tags = dbTagList.map((dbTag) => Tag.fromDb(dbTag)).toList(); return tags;
return tags; } else
return [];
} }
} }
...@@ -204,7 +204,6 @@ class _ShowAthleteScreenState extends State<ShowAthleteScreen> { ...@@ -204,7 +204,6 @@ class _ShowAthleteScreenState extends State<ShowAthleteScreen> {
} }
recalculate() async { recalculate() async {
print("Start");
List<Activity> activities; List<Activity> activities;
activities = await Activity.all(athlete: widget.athlete); activities = await Activity.all(athlete: widget.athlete);
int index = 0; int index = 0;
......
...@@ -615,14 +615,14 @@ packages: ...@@ -615,14 +615,14 @@ packages:
name: sqfentity name: sqfentity
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.3+1" version: "1.3.5+3"
sqfentity_gen: sqfentity_gen:
dependency: "direct main" dependency: "direct main"
description: description:
name: sqfentity_gen name: sqfentity_gen
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.3+3" version: "1.3.5+4"
sqflite: sqflite:
dependency: transitive dependency: transitive
description: description:
......
...@@ -12,8 +12,8 @@ dependencies: ...@@ -12,8 +12,8 @@ dependencies:
flutter_launcher_icons: ^0.7.2 flutter_launcher_icons: ^0.7.2
cupertino_icons: ^0.1.2 cupertino_icons: ^0.1.2
strava_flutter: ^1.2.1+54 strava_flutter: ^1.2.1+54
sqfentity: 1.2.3+1 sqfentity: 1.3.5+3
sqfentity_gen: 1.2.3+3 sqfentity_gen: 1.3.5+4
dio: ^3.0.7 dio: ^3.0.7
dio_cookie_manager: ^1.0.0 dio_cookie_manager: ^1.0.0
......
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