Skip to content

Commit

Permalink
fix TrackerState not settable
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonIT committed Dec 17, 2019
1 parent ba6bbbf commit 3866f64
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 16 deletions.
10 changes: 7 additions & 3 deletions lib/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,21 @@ Future<void> 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(<String, String>{
"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 <String, String>{
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class _TimeTrackerState extends State<TimeTracker> {
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(
Expand Down
64 changes: 52 additions & 12 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"

0 comments on commit 3866f64

Please sign in to comment.