Merge branch 'feature/null-safety' into core-nnbd

This commit is contained in:
Salvatore Giordano
2021-04-20 13:14:52 +02:00
committed by GitHub
3 changed files with 5 additions and 6 deletions
@@ -23,7 +23,7 @@ OwnUser _$OwnUserFromJson(Map<String, dynamic> json) {
.toList() ??
[],
id: json['id'] as String,
role: json['role'] as String? ?? '',
role: json['role'] as String,
createdAt: json['created_at'] == null
? null
: DateTime.parse(json['created_at'] as String),
@@ -9,7 +9,7 @@ class User {
/// Constructor used for json serialization
User({
required this.id,
this.role = '',
this.role,
DateTime? createdAt,
DateTime? updatedAt,
this.lastActive,
@@ -41,9 +41,8 @@ class User {
final String id;
/// User role
@JsonKey(
includeIfNull: false, toJson: Serialization.readOnly, defaultValue: '')
final String role;
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly)
final String? role;
/// User role
@JsonKey(
@@ -9,7 +9,7 @@ part of 'user.dart';
User _$UserFromJson(Map<String, dynamic> json) {
return User(
id: json['id'] as String,
role: json['role'] as String? ?? '',
role: json['role'] as String?,
createdAt: json['created_at'] == null
? null
: DateTime.parse(json['created_at'] as String),