Task edit #37
|
@ -1,9 +1,13 @@
|
|||
import 'package:meta/meta.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'package:vikunja_app/models/label.dart';
|
||||
import 'package:vikunja_app/models/user.dart';
|
||||
import 'package:vikunja_app/utils/datetime_to_unix.dart';
|
||||
|
||||
part 'task.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable(nullable: true)
|
||||
class Task {
|
||||
final int id, parentTaskID, priority;
|
||||
final DateTime created, updated, dueDate, startDate, endDate;
|
||||
|
@ -32,31 +36,39 @@ class Task {
|
|||
this.created,
|
||||
this.updated,
|
||||
this.createdBy});
|
||||
|
||||
Task.fromJson(Map<String, dynamic> json)
|
||||
factory Task.fromJson(Map<String, dynamic> json) => _$TaskFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$TaskToJson(this);
|
||||
/*
|
||||
Task.fromJson(Map<String, dynamic> json)
|
||||
: id = json['id'],
|
||||
text = json['text'],
|
||||
description = json['description'],
|
||||
done = json['done'],
|
||||
reminderDates = (json['reminderDates'] as List<dynamic>)
|
||||
?.map((milli) => dateTimeFromUnixTimestamp(milli))
|
||||
?.toList(),
|
||||
reminderDates = json['reminderDates'] == null
|
||||
? null
|
||||
: (json['reminderDates'].cast<int>() as List<dynamic>)
|
||||
?.map((milli) => dateTimeFromUnixTimestamp(milli))
|
||||
?.toList(),
|
||||
dueDate = dateTimeFromUnixTimestamp(json['dueDate']),
|
||||
startDate = dateTimeFromUnixTimestamp(json['startDate']),
|
||||
endDate = dateTimeFromUnixTimestamp(json['endDate']),
|
||||
parentTaskID = json['parentTaskID'],
|
||||
priority = json['priority'],
|
||||
repeatAfter = Duration(seconds: json['repeatAfter']),
|
||||
labels = (json['labels'] as List<dynamic>)
|
||||
?.map((label) => Label.fromJson(label))
|
||||
?.toList(),
|
||||
subtasks = (json['subtasks'] as List<dynamic>)
|
||||
?.map((subtask) => Task.fromJson(subtask))
|
||||
?.toList(),
|
||||
labels = json['labels'] == null
|
||||
? null
|
||||
: (json['labels'] as List<dynamic>)
|
||||
?.map((label) => Label.fromJson(label))
|
||||
?.toList(),
|
||||
subtasks = json['subtasks'] == null
|
||||
? null
|
||||
: (json['subtasks'] as List<dynamic>)
|
||||
?.map((subtask) => Task.fromJson(subtask))
|
||||
?.toList(),
|
||||
updated = dateTimeFromUnixTimestamp(json['updated']),
|
||||
created = dateTimeFromUnixTimestamp(json['created']),
|
||||
createdBy = User.fromJson(json['createdBy']);
|
||||
|
||||
*/
|
||||
toJSON() => {
|
||||
'id': id,
|
||||
'text': text,
|
||||
|
|
|
@ -86,6 +86,7 @@ class _TaskEditPageState extends State<TaskEditPage> {
|
|||
padding: EdgeInsets.symmetric(vertical: 10.0),
|
||||
child: DateTimePickerFormField(
|
||||
dateOnly: false,
|
||||
initialDate: widget.task.dueDate,
|
||||
format: vDateFormatLong,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'Due Date',
|
||||
|
|
111
pubspec.lock
111
pubspec.lock
|
@ -1,6 +1,13 @@
|
|||
# Generated by pub
|
||||
# See https://www.dartlang.org/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
analyzer:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: analyzer
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.35.4"
|
||||
archive:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -29,6 +36,20 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.4"
|
||||
build:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: build
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
build_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_config
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.3.1+4"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -73,8 +94,15 @@ packages:
|
|||
url: "https://github.com/MarkOSullivan94/dart_config.git"
|
||||
source: git
|
||||
version: "0.5.0"
|
||||
dart_style:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: dart_style
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.4"
|
||||
datetime_picker_formfield:
|
||||
dependency: "direct dev"
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: datetime_picker_formfield
|
||||
url: "https://pub.dartlang.org"
|
||||
|
@ -104,6 +132,20 @@ packages:
|
|||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
front_end:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: front_end
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.14"
|
||||
glob:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: glob
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.7"
|
||||
http:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -132,6 +174,34 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.15.7"
|
||||
json_annotation:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: json_annotation
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
json_serializable:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: json_serializable
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.3"
|
||||
kernel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: kernel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.3.14"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: logging
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.11.3+2"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -146,6 +216,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.6"
|
||||
package_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: package_config
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.5"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -154,12 +231,26 @@ packages:
|
|||
source: hosted
|
||||
version: "1.6.2"
|
||||
petitparser:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: petitparser
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
pub_semver:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pub_semver
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.4.2"
|
||||
pubspec_parse:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pubspec_parse
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.4"
|
||||
quiver:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -172,6 +263,13 @@ packages:
|
|||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.99"
|
||||
source_gen:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_gen
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.9.4+1"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -228,6 +326,13 @@ packages:
|
|||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.8"
|
||||
watcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: watcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.9.7+10"
|
||||
xml:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -243,5 +348,5 @@ packages:
|
|||
source: hosted
|
||||
version: "2.1.15"
|
||||
sdks:
|
||||
dart: ">=2.0.0 <3.0.0"
|
||||
dart: ">=2.1.0-dev.5.0 <3.0.0"
|
||||
flutter: ">=0.1.2 <2.0.0"
|
||||
|
|
|
@ -9,18 +9,18 @@ environment:
|
|||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^0.1.2
|
||||
flutter_secure_storage: 3.1.1
|
||||
http: 0.12.0
|
||||
datetime_picker_formfield: ^0.1.8
|
||||
build: ^1.1.1
|
||||
json_serializable: ^2.0.3
|
||||
petitparser: ^2.1.1
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
flutter_launcher_icons: "^0.6.1"
|
||||
datetime_picker_formfield: ^0.1.8
|
||||
|
||||
flutter_icons:
|
||||
image_path: "assets/vikunja_logo.png"
|
||||
|
|
Reference in New Issue
parentTaskID
=>parentTaskId