From 3866f64d08cd186f16fc389a22f83622e43b77b1 Mon Sep 17 00:00:00 2001 From: SimonIT Date: Tue, 17 Dec 2019 01:15:02 +0100 Subject: [PATCH] fix TrackerState not settable --- lib/api.dart | 10 +++++--- lib/main.dart | 2 +- pubspec.lock | 64 +++++++++++++++++++++++++++++++++++++++++---------- 3 files changed, 60 insertions(+), 16 deletions(-) diff --git a/lib/api.dart b/lib/api.dart index f0bb575..42296ca 100644 --- a/lib/api.dart +++ b/lib/api.dart @@ -112,17 +112,21 @@ Future setTrackerState(TrackerState state) async { "timer_state[started_at]": state.started_at, "timer_state[stopped_at]": state.stopped_at, "timer_state[ended_at]": state.ended_at, - "timer_state[paused_duration]": state.paused_duration, + "timer_state[paused_duration]": state.paused_duration ?? "0", "timer_state[entry_date]": state.entry_date, "timer_state[comment]": state.comment, "timer_state[manual_time_change]": state.manual_time_change, - "timer_state[unbillable]": state.unbillable, }; + if (state.unbillable != null) { + body.addAll({ + "timer_state[unbillable]": state.unbillable, + }); + } if (state.project != null) { body.addAll({ "timer_state[project][id]": state.project.id, "timer_state[project][name]": state.project.name, - "timer_state[project][customer]": state.project.customer + "timer_state[project][customer]": state.project.customer, }); } else { body.addAll(const { diff --git a/lib/main.dart b/lib/main.dart index 655f301..21ea35b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -216,7 +216,7 @@ class _TimeTrackerState extends State { showCupertinoDialog( context: context, builder: (BuildContext context) => CupertinoAlertDialog( - title: title ?? const Text("Ein Fehler ist aufgetreten"), + title: Text(title ?? "Ein Fehler ist aufgetreten"), content: Text(e.toString()), actions: [ CupertinoDialogAction( diff --git a/pubspec.lock b/pubspec.lock index 2961662..e4ae27f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -84,7 +84,7 @@ packages: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "4.2.0" + version: "4.3.0" built_collection: dependency: transitive description: @@ -210,7 +210,7 @@ packages: name: flutter_easyrefresh url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.8" flutter_keyboard_visibility: dependency: transitive description: @@ -244,6 +244,11 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.7.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" front_end: dependency: transitive description: @@ -313,7 +318,7 @@ packages: name: in_app_purchase url: "https://pub.dartlang.org" source: hosted - version: "0.2.2+3" + version: "0.2.2+4" intl: dependency: "direct main" description: @@ -418,7 +423,7 @@ packages: name: package_info url: "https://pub.dartlang.org" source: hosted - version: "0.4.0+12" + version: "0.4.0+13" package_resolver: dependency: transitive description: @@ -439,7 +444,7 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "1.4.5" + version: "1.5.1" pedantic: dependency: transitive description: @@ -461,6 +466,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.2.1" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" pool: dependency: transitive description: @@ -495,14 +507,28 @@ packages: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "0.5.4+8" + version: "0.5.6" + shared_preferences_macos: + dependency: transitive + description: + name: shared_preferences_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+3" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.2+2" shelf: dependency: transitive description: @@ -542,7 +568,7 @@ packages: name: sqflite url: "https://pub.dartlang.org" source: hosted - version: "1.1.7+3" + version: "1.2.0" stack_trace: dependency: transitive description: @@ -577,7 +603,7 @@ packages: name: synchronized url: "https://pub.dartlang.org" source: hosted - version: "2.1.0+2" + version: "2.1.1" term_glyph: dependency: transitive description: @@ -612,14 +638,28 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "5.2.7" + version: "5.4.1" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+2" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.4" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.0+2" uuid: dependency: "direct main" description: @@ -664,4 +704,4 @@ packages: version: "2.2.0" sdks: dart: ">=2.6.0 <3.0.0" - flutter: ">=1.9.1+hotfix.5 <2.0.0" + flutter: ">=1.12.13+hotfix.4 <2.0.0"