This repository has been archived on 2022-04-20. You can view files and clone it, but cannot push or open issues or pull requests.
2018-09-22 20:56:16 +00:00
|
|
|
import 'package:vikunja_app/models/user.dart';
|
2018-09-16 19:47:33 +00:00
|
|
|
import 'package:meta/meta.dart';
|
|
|
|
|
|
|
|
class Namespace {
|
|
|
|
final int id;
|
|
|
|
final DateTime created, updated;
|
|
|
|
final String name, description;
|
|
|
|
final User owner;
|
|
|
|
|
|
|
|
Namespace(
|
|
|
|
{@required this.id,
|
|
|
|
this.created,
|
|
|
|
this.updated,
|
|
|
|
@required this.name,
|
|
|
|
this.description,
|
|
|
|
this.owner});
|
|
|
|
|
|
|
|
Namespace.fromJson(Map<String, dynamic> json)
|
|
|
|
: name = json['name'],
|
|
|
|
description = json['description'],
|
|
|
|
id = json['id'],
|
|
|
|
created = DateTime.fromMillisecondsSinceEpoch(json['created']),
|
|
|
|
updated = DateTime.fromMillisecondsSinceEpoch(json['updated']),
|
|
|
|
owner = User.fromJson(json['owner']);
|
2018-09-17 16:16:50 +00:00
|
|
|
|
|
|
|
toJSON() => {
|
|
|
|
"created": created?.millisecondsSinceEpoch,
|
|
|
|
"updated": updated?.millisecondsSinceEpoch,
|
|
|
|
"name": name,
|
|
|
|
"owner": owner?.toJSON(),
|
|
|
|
"description": description
|
|
|
|
};
|
2018-09-16 19:47:33 +00:00
|
|
|
}
|