Started creating the color

This commit is contained in:
kolaente 2019-03-19 20:03:11 +01:00
parent 45eb087228
commit 714aed4603
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 7 additions and 4 deletions

View File

@ -1,17 +1,20 @@
import 'dart:ui';
import 'package:meta/meta.dart';
import 'package:vikunja_app/models/user.dart';
class Label {
final int id;
final String title, description, hexColor;
final String title, description;
final DateTime created, updated;
final User createdBy;
final Color color;
Label(
{@required this.id,
this.title,
this.description,
this.hexColor,
this.color,
this.created,
this.updated,
this.createdBy});
@ -20,7 +23,7 @@ class Label {
: id = json['id'],
title = json['title'],
description = json['description'],
hexColor = json['hex_color'],
color = new Color(int.parse(json['hex_color'], radix: 16) + 0xFF000000),
updated = DateTime.fromMillisecondsSinceEpoch(json['updated']),
created = DateTime.fromMillisecondsSinceEpoch(json['created']),
createdBy = User.fromJson(json['created_by']);
@ -29,7 +32,7 @@ class Label {
'id': id,
'title': title,
'description': description,
'hex_color': description,
'hex_color': color.toString(),
'created_by': createdBy?.toJSON(),
'updated': updated?.millisecondsSinceEpoch,
'created': created?.millisecondsSinceEpoch,