37 lines
914 B
Dart
37 lines
914 B
Dart
import 'package:meta/meta.dart';
|
|
import 'package:vikunja_app/models/user.dart';
|
|
|
|
class TaskList {
|
|
final int id;
|
|
final String title, description;
|
|
final User owner;
|
|
final DateTime created, updated;
|
|
|
|
TaskList(
|
|
{@required this.id,
|
|
@required this.title,
|
|
this.description,
|
|
this.owner,
|
|
this.created,
|
|
this.updated});
|
|
|
|
TaskList.fromJson(Map<String, dynamic> json)
|
|
: id = json['id'],
|
|
owner = User.fromJson(json['owner']),
|
|
description = json['description'],
|
|
title = json['title'],
|
|
updated = DateTime.parse(json['updated']),
|
|
created = DateTime.parse(json['created']);
|
|
|
|
toJSON() {
|
|
return {
|
|
"id": this.id,
|
|
"title": this.title,
|
|
"description": this.description,
|
|
"owner": this.owner?.toJSON(),
|
|
"created": this.created?.toIso8601String(),
|
|
"updated": this.updated?.toIso8601String(),
|
|
};
|
|
}
|
|
}
|