Null aware handler for the owner field

This commit is contained in:
Aleksandr Borisenko 2021-03-19 21:13:44 +03:00
parent 50e17b045a
commit 7bb04473a3
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ class TaskList {
TaskList.fromJson(Map<String, dynamic> json, {tasksJson})
: id = json['id'],
owner = User.fromJson(json['owner']),
owner = json['owner'] == null ? null : User.fromJson(json['owner']),
description = json['description'],
title = json['title'],
updated = DateTime.parse(json['updated']),