diff --git a/packages/amplify_datastore/example/lib/models/BelongsToChildExplicit.dart b/packages/amplify_datastore/example/lib/models/BelongsToChildExplicit.dart index ac4410799f..0fec098f8c 100644 --- a/packages/amplify_datastore/example/lib/models/BelongsToChildExplicit.dart +++ b/packages/amplify_datastore/example/lib/models/BelongsToChildExplicit.dart @@ -98,13 +98,13 @@ class BelongsToChildExplicit extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("belongsToParent=" + - (_belongsToParent != null ? _belongsToParent.toString() : "null") + + (_belongsToParent != null ? _belongsToParent!.toString() : "null") + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/BelongsToChildImplicit.dart b/packages/amplify_datastore/example/lib/models/BelongsToChildImplicit.dart index 939438988d..5721dc0a66 100644 --- a/packages/amplify_datastore/example/lib/models/BelongsToChildImplicit.dart +++ b/packages/amplify_datastore/example/lib/models/BelongsToChildImplicit.dart @@ -98,13 +98,13 @@ class BelongsToChildImplicit extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("belongsToParent=" + - (_belongsToParent != null ? _belongsToParent.toString() : "null") + + (_belongsToParent != null ? _belongsToParent!.toString() : "null") + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/BelongsToParent.dart b/packages/amplify_datastore/example/lib/models/BelongsToParent.dart index 433b6186e5..fa8f2d1679 100644 --- a/packages/amplify_datastore/example/lib/models/BelongsToParent.dart +++ b/packages/amplify_datastore/example/lib/models/BelongsToParent.dart @@ -136,10 +136,10 @@ class BelongsToParent extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write("updatedAt=" + - (_updatedAt != null ? _updatedAt.format() : "null") + + (_updatedAt != null ? _updatedAt!.format() : "null") + ", "); buffer.write("belongsToParentImplicitChildId=" + "$_belongsToParentImplicitChildId" + diff --git a/packages/amplify_datastore/example/lib/models/Blog.dart b/packages/amplify_datastore/example/lib/models/Blog.dart index 7573775394..d44cda2f11 100644 --- a/packages/amplify_datastore/example/lib/models/Blog.dart +++ b/packages/amplify_datastore/example/lib/models/Blog.dart @@ -107,10 +107,10 @@ class Blog extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); @@ -132,18 +132,20 @@ class Blog extends amplify_core.Model { Blog.fromJson(Map json) : id = json['id'], _name = json['name'], - _posts = json['posts'] != null - ? json['posts'] is Map + _posts = json['posts'] is Map + ? (json['posts']['items'] is List ? (json['posts']['items'] as List) .where((e) => e != null) .map((e) => Post.fromJson(new Map.from(e))) .toList() - : (json['posts'] as List) + : null) + : (json['posts'] is List + ? (json['posts'] as List) .where((e) => e?['serializedData'] != null) .map((e) => Post.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null, diff --git a/packages/amplify_datastore/example/lib/models/Comment.dart b/packages/amplify_datastore/example/lib/models/Comment.dart index a98a6f17b2..6236a3d272 100644 --- a/packages/amplify_datastore/example/lib/models/Comment.dart +++ b/packages/amplify_datastore/example/lib/models/Comment.dart @@ -104,13 +104,13 @@ class Comment extends amplify_core.Model { buffer.write("Comment {"); buffer.write("id=" + "$id" + ", "); - buffer.write("post=" + (_post != null ? _post.toString() : "null") + ", "); + buffer.write("post=" + (_post != null ? _post!.toString() : "null") + ", "); buffer.write("content=" + "$_content" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/CpkHasManyChildBidirectionalExplicit.dart b/packages/amplify_datastore/example/lib/models/CpkHasManyChildBidirectionalExplicit.dart index 9be873a722..2777929201 100644 --- a/packages/amplify_datastore/example/lib/models/CpkHasManyChildBidirectionalExplicit.dart +++ b/packages/amplify_datastore/example/lib/models/CpkHasManyChildBidirectionalExplicit.dart @@ -120,13 +120,13 @@ class CpkHasManyChildBidirectionalExplicit extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("hasManyParent=" + - (_hasManyParent != null ? _hasManyParent.toString() : "null") + + (_hasManyParent != null ? _hasManyParent!.toString() : "null") + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/CpkHasManyChildBidirectionalImplicit.dart b/packages/amplify_datastore/example/lib/models/CpkHasManyChildBidirectionalImplicit.dart index f320d39e6c..e4eac30962 100644 --- a/packages/amplify_datastore/example/lib/models/CpkHasManyChildBidirectionalImplicit.dart +++ b/packages/amplify_datastore/example/lib/models/CpkHasManyChildBidirectionalImplicit.dart @@ -120,13 +120,13 @@ class CpkHasManyChildBidirectionalImplicit extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("hasManyParent=" + - (_hasManyParent != null ? _hasManyParent.toString() : "null") + + (_hasManyParent != null ? _hasManyParent!.toString() : "null") + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/CpkHasManyParentBidirectionalExplicit.dart b/packages/amplify_datastore/example/lib/models/CpkHasManyParentBidirectionalExplicit.dart index f77305805f..a1280ddc1c 100644 --- a/packages/amplify_datastore/example/lib/models/CpkHasManyParentBidirectionalExplicit.dart +++ b/packages/amplify_datastore/example/lib/models/CpkHasManyParentBidirectionalExplicit.dart @@ -132,10 +132,10 @@ class CpkHasManyParentBidirectionalExplicit extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); @@ -165,21 +165,22 @@ class CpkHasManyParentBidirectionalExplicit extends amplify_core.Model { CpkHasManyParentBidirectionalExplicit.fromJson(Map json) : id = json['id'], _name = json['name'], - _bidirectionalExplicitChildren = json[ - 'bidirectionalExplicitChildren'] != - null - ? json['bidirectionalExplicitChildren'] is Map + _bidirectionalExplicitChildren = json['bidirectionalExplicitChildren'] + is Map + ? (json['bidirectionalExplicitChildren']['items'] is List ? (json['bidirectionalExplicitChildren']['items'] as List) .where((e) => e != null) .map((e) => CpkHasManyChildBidirectionalExplicit.fromJson( new Map.from(e))) .toList() - : (json['bidirectionalExplicitChildren'] as List) + : null) + : (json['bidirectionalExplicitChildren'] is List + ? (json['bidirectionalExplicitChildren'] as List) .where((e) => e?['serializedData'] != null) .map((e) => CpkHasManyChildBidirectionalExplicit.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null, diff --git a/packages/amplify_datastore/example/lib/models/CpkHasManyParentBidirectionalImplicit.dart b/packages/amplify_datastore/example/lib/models/CpkHasManyParentBidirectionalImplicit.dart index e605fa46aa..2593d822b9 100644 --- a/packages/amplify_datastore/example/lib/models/CpkHasManyParentBidirectionalImplicit.dart +++ b/packages/amplify_datastore/example/lib/models/CpkHasManyParentBidirectionalImplicit.dart @@ -132,10 +132,10 @@ class CpkHasManyParentBidirectionalImplicit extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); @@ -165,21 +165,22 @@ class CpkHasManyParentBidirectionalImplicit extends amplify_core.Model { CpkHasManyParentBidirectionalImplicit.fromJson(Map json) : id = json['id'], _name = json['name'], - _bidirectionalImplicitChildren = json[ - 'bidirectionalImplicitChildren'] != - null - ? json['bidirectionalImplicitChildren'] is Map + _bidirectionalImplicitChildren = json['bidirectionalImplicitChildren'] + is Map + ? (json['bidirectionalImplicitChildren']['items'] is List ? (json['bidirectionalImplicitChildren']['items'] as List) .where((e) => e != null) .map((e) => CpkHasManyChildBidirectionalImplicit.fromJson( new Map.from(e))) .toList() - : (json['bidirectionalImplicitChildren'] as List) + : null) + : (json['bidirectionalImplicitChildren'] is List + ? (json['bidirectionalImplicitChildren'] as List) .where((e) => e?['serializedData'] != null) .map((e) => CpkHasManyChildBidirectionalImplicit.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null, diff --git a/packages/amplify_datastore/example/lib/models/CpkHasManyUnidirectionalChildExplicit.dart b/packages/amplify_datastore/example/lib/models/CpkHasManyUnidirectionalChildExplicit.dart index ca54a2bdac..4194c62a48 100644 --- a/packages/amplify_datastore/example/lib/models/CpkHasManyUnidirectionalChildExplicit.dart +++ b/packages/amplify_datastore/example/lib/models/CpkHasManyUnidirectionalChildExplicit.dart @@ -154,10 +154,10 @@ class CpkHasManyUnidirectionalChildExplicit extends amplify_core.Model { buffer.write("hasManyParentID=" + "$_hasManyParentID" + ", "); buffer.write("hasManyParentName=" + "$_hasManyParentName" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/CpkHasManyUnidirectionalChildImplicit.dart b/packages/amplify_datastore/example/lib/models/CpkHasManyUnidirectionalChildImplicit.dart index 02e8a141f5..8195848103 100644 --- a/packages/amplify_datastore/example/lib/models/CpkHasManyUnidirectionalChildImplicit.dart +++ b/packages/amplify_datastore/example/lib/models/CpkHasManyUnidirectionalChildImplicit.dart @@ -140,10 +140,10 @@ class CpkHasManyUnidirectionalChildImplicit extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write("updatedAt=" + - (_updatedAt != null ? _updatedAt.format() : "null") + + (_updatedAt != null ? _updatedAt!.format() : "null") + ", "); buffer.write("cpkHasManyUnidirectionalParentImplicitChildrenId=" + "$_cpkHasManyUnidirectionalParentImplicitChildrenId" + diff --git a/packages/amplify_datastore/example/lib/models/CpkHasManyUnidirectionalParent.dart b/packages/amplify_datastore/example/lib/models/CpkHasManyUnidirectionalParent.dart index 413b6eb29d..36a88b6b20 100644 --- a/packages/amplify_datastore/example/lib/models/CpkHasManyUnidirectionalParent.dart +++ b/packages/amplify_datastore/example/lib/models/CpkHasManyUnidirectionalParent.dart @@ -142,10 +142,10 @@ class CpkHasManyUnidirectionalParent extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); @@ -180,32 +180,36 @@ class CpkHasManyUnidirectionalParent extends amplify_core.Model { CpkHasManyUnidirectionalParent.fromJson(Map json) : id = json['id'], _name = json['name'], - _implicitChildren = json['implicitChildren'] != null - ? json['implicitChildren'] is Map + _implicitChildren = json['implicitChildren'] is Map + ? (json['implicitChildren']['items'] is List ? (json['implicitChildren']['items'] as List) .where((e) => e != null) .map((e) => CpkHasManyUnidirectionalChildImplicit.fromJson( new Map.from(e))) .toList() - : (json['implicitChildren'] as List) + : null) + : (json['implicitChildren'] is List + ? (json['implicitChildren'] as List) .where((e) => e?['serializedData'] != null) .map((e) => CpkHasManyUnidirectionalChildImplicit.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, - _explicitChildren = json['explicitChildren'] != null - ? json['explicitChildren'] is Map + : null), + _explicitChildren = json['explicitChildren'] is Map + ? (json['explicitChildren']['items'] is List ? (json['explicitChildren']['items'] as List) .where((e) => e != null) .map((e) => CpkHasManyUnidirectionalChildExplicit.fromJson( new Map.from(e))) .toList() - : (json['explicitChildren'] as List) + : null) + : (json['explicitChildren'] is List + ? (json['explicitChildren'] as List) .where((e) => e?['serializedData'] != null) .map((e) => CpkHasManyUnidirectionalChildExplicit.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null, diff --git a/packages/amplify_datastore/example/lib/models/CpkHasOneUnidirectionalChild.dart b/packages/amplify_datastore/example/lib/models/CpkHasOneUnidirectionalChild.dart index 6853a9a63a..784022d097 100644 --- a/packages/amplify_datastore/example/lib/models/CpkHasOneUnidirectionalChild.dart +++ b/packages/amplify_datastore/example/lib/models/CpkHasOneUnidirectionalChild.dart @@ -105,10 +105,10 @@ class CpkHasOneUnidirectionalChild extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/CpkHasOneUnidirectionalParent.dart b/packages/amplify_datastore/example/lib/models/CpkHasOneUnidirectionalParent.dart index d1213aca75..bf37a2bb36 100644 --- a/packages/amplify_datastore/example/lib/models/CpkHasOneUnidirectionalParent.dart +++ b/packages/amplify_datastore/example/lib/models/CpkHasOneUnidirectionalParent.dart @@ -180,10 +180,10 @@ class CpkHasOneUnidirectionalParent extends amplify_core.Model { buffer.write("explicitChildID=" + "$_explicitChildID" + ", "); buffer.write("explicitChildName=" + "$_explicitChildName" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write("updatedAt=" + - (_updatedAt != null ? _updatedAt.format() : "null") + + (_updatedAt != null ? _updatedAt!.format() : "null") + ", "); buffer.write("cpkHasOneUnidirectionalParentImplicitChildId=" + "$_cpkHasOneUnidirectionalParentImplicitChildId" + diff --git a/packages/amplify_datastore/example/lib/models/CpkInventory.dart b/packages/amplify_datastore/example/lib/models/CpkInventory.dart index dbad7784f4..5ca29f017e 100644 --- a/packages/amplify_datastore/example/lib/models/CpkInventory.dart +++ b/packages/amplify_datastore/example/lib/models/CpkInventory.dart @@ -160,10 +160,10 @@ class CpkInventory extends amplify_core.Model { buffer.write("warehouseId=" + "$_warehouseId" + ", "); buffer.write("description=" + "$_description" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/CpkManyToManyPost.dart b/packages/amplify_datastore/example/lib/models/CpkManyToManyPost.dart index 37be1fbd6d..1b6c010ca6 100644 --- a/packages/amplify_datastore/example/lib/models/CpkManyToManyPost.dart +++ b/packages/amplify_datastore/example/lib/models/CpkManyToManyPost.dart @@ -108,10 +108,10 @@ class CpkManyToManyPost extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("title=" + "$_title" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); @@ -134,19 +134,21 @@ class CpkManyToManyPost extends amplify_core.Model { CpkManyToManyPost.fromJson(Map json) : id = json['id'], _title = json['title'], - _tags = json['tags'] != null - ? json['tags'] is Map + _tags = json['tags'] is Map + ? (json['tags']['items'] is List ? (json['tags']['items'] as List) .where((e) => e != null) .map((e) => CpkPostTags.fromJson(new Map.from(e))) .toList() - : (json['tags'] as List) + : null) + : (json['tags'] is List + ? (json['tags'] as List) .where((e) => e?['serializedData'] != null) .map((e) => CpkPostTags.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null, diff --git a/packages/amplify_datastore/example/lib/models/CpkManyToManyTag.dart b/packages/amplify_datastore/example/lib/models/CpkManyToManyTag.dart index 319c7622f9..67148f79a8 100644 --- a/packages/amplify_datastore/example/lib/models/CpkManyToManyTag.dart +++ b/packages/amplify_datastore/example/lib/models/CpkManyToManyTag.dart @@ -117,10 +117,10 @@ class CpkManyToManyTag extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("label=" + "$_label" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); @@ -140,19 +140,21 @@ class CpkManyToManyTag extends amplify_core.Model { CpkManyToManyTag.fromJson(Map json) : id = json['id'], _label = json['label'], - _posts = json['posts'] != null - ? json['posts'] is Map + _posts = json['posts'] is Map + ? (json['posts']['items'] is List ? (json['posts']['items'] as List) .where((e) => e != null) .map((e) => CpkPostTags.fromJson(new Map.from(e))) .toList() - : (json['posts'] as List) + : null) + : (json['posts'] is List + ? (json['posts'] as List) .where((e) => e?['serializedData'] != null) .map((e) => CpkPostTags.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null, diff --git a/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalChildExplicitCD.dart b/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalChildExplicitCD.dart index ea33b2f95c..a2f2255597 100644 --- a/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalChildExplicitCD.dart +++ b/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalChildExplicitCD.dart @@ -120,13 +120,13 @@ class CpkOneToOneBidirectionalChildExplicitCD extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("belongsToParent=" + - (_belongsToParent != null ? _belongsToParent.toString() : "null") + + (_belongsToParent != null ? _belongsToParent!.toString() : "null") + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalChildExplicitID.dart b/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalChildExplicitID.dart index 59711b032f..4c67a48d55 100644 --- a/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalChildExplicitID.dart +++ b/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalChildExplicitID.dart @@ -120,13 +120,13 @@ class CpkOneToOneBidirectionalChildExplicitID extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("belongsToParent=" + - (_belongsToParent != null ? _belongsToParent.toString() : "null") + + (_belongsToParent != null ? _belongsToParent!.toString() : "null") + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalChildImplicitCD.dart b/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalChildImplicitCD.dart index f79cd646e6..4bb5a075f2 100644 --- a/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalChildImplicitCD.dart +++ b/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalChildImplicitCD.dart @@ -120,13 +120,13 @@ class CpkOneToOneBidirectionalChildImplicitCD extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("belongsToParent=" + - (_belongsToParent != null ? _belongsToParent.toString() : "null") + + (_belongsToParent != null ? _belongsToParent!.toString() : "null") + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalChildImplicitID.dart b/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalChildImplicitID.dart index 5e5662bb69..cb2fa8c0aa 100644 --- a/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalChildImplicitID.dart +++ b/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalChildImplicitID.dart @@ -120,13 +120,13 @@ class CpkOneToOneBidirectionalChildImplicitID extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("belongsToParent=" + - (_belongsToParent != null ? _belongsToParent.toString() : "null") + + (_belongsToParent != null ? _belongsToParent!.toString() : "null") + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalParentCD.dart b/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalParentCD.dart index b1b445ad2f..077efa2c2a 100644 --- a/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalParentCD.dart +++ b/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalParentCD.dart @@ -199,10 +199,10 @@ class CpkOneToOneBidirectionalParentCD extends amplify_core.Model { buffer.write("customId=" + "$_customId" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write("updatedAt=" + - (_updatedAt != null ? _updatedAt.format() : "null") + + (_updatedAt != null ? _updatedAt!.format() : "null") + ", "); buffer.write("cpkOneToOneBidirectionalParentCDImplicitChildId=" + "$_cpkOneToOneBidirectionalParentCDImplicitChildId" + diff --git a/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalParentID.dart b/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalParentID.dart index 28b0750829..581875ad81 100644 --- a/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalParentID.dart +++ b/packages/amplify_datastore/example/lib/models/CpkOneToOneBidirectionalParentID.dart @@ -185,10 +185,10 @@ class CpkOneToOneBidirectionalParentID extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write("updatedAt=" + - (_updatedAt != null ? _updatedAt.format() : "null") + + (_updatedAt != null ? _updatedAt!.format() : "null") + ", "); buffer.write("cpkOneToOneBidirectionalParentIDImplicitChildId=" + "$_cpkOneToOneBidirectionalParentIDImplicitChildId" + diff --git a/packages/amplify_datastore/example/lib/models/CpkPostTags.dart b/packages/amplify_datastore/example/lib/models/CpkPostTags.dart index 33c35c657f..1545121ceb 100644 --- a/packages/amplify_datastore/example/lib/models/CpkPostTags.dart +++ b/packages/amplify_datastore/example/lib/models/CpkPostTags.dart @@ -121,16 +121,16 @@ class CpkPostTags extends amplify_core.Model { buffer.write("CpkPostTags {"); buffer.write("id=" + "$id" + ", "); buffer.write("cpkManyToManyPost=" + - (_cpkManyToManyPost != null ? _cpkManyToManyPost.toString() : "null") + + (_cpkManyToManyPost != null ? _cpkManyToManyPost!.toString() : "null") + ", "); buffer.write("cpkManyToManyTag=" + - (_cpkManyToManyTag != null ? _cpkManyToManyTag.toString() : "null") + + (_cpkManyToManyTag != null ? _cpkManyToManyTag!.toString() : "null") + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/CustomTypeWithAppsyncScalarTypes.dart b/packages/amplify_datastore/example/lib/models/CustomTypeWithAppsyncScalarTypes.dart index d678bf8514..db943926cf 100644 --- a/packages/amplify_datastore/example/lib/models/CustomTypeWithAppsyncScalarTypes.dart +++ b/packages/amplify_datastore/example/lib/models/CustomTypeWithAppsyncScalarTypes.dart @@ -399,86 +399,86 @@ class CustomTypeWithAppsyncScalarTypes { buffer.write("CustomTypeWithAppsyncScalarTypes {"); buffer.write("stringValue=" + "$_stringValue" + ", "); buffer.write("listOfStringValue=" + - (_listOfStringValue != null ? _listOfStringValue.toString() : "null") + + (_listOfStringValue != null ? _listOfStringValue!.toString() : "null") + ", "); buffer.write("intValue=" + - (_intValue != null ? _intValue.toString() : "null") + + (_intValue != null ? _intValue!.toString() : "null") + ", "); buffer.write("listOfIntValue=" + - (_listOfIntValue != null ? _listOfIntValue.toString() : "null") + + (_listOfIntValue != null ? _listOfIntValue!.toString() : "null") + ", "); buffer.write("floatValue=" + - (_floatValue != null ? _floatValue.toString() : "null") + + (_floatValue != null ? _floatValue!.toString() : "null") + ", "); buffer.write("listOfFloatValue=" + - (_listOfFloatValue != null ? _listOfFloatValue.toString() : "null") + + (_listOfFloatValue != null ? _listOfFloatValue!.toString() : "null") + ", "); buffer.write("booleanValue=" + - (_booleanValue != null ? _booleanValue.toString() : "null") + + (_booleanValue != null ? _booleanValue!.toString() : "null") + ", "); buffer.write("listOfBooleanValue=" + (_listOfBooleanValue != null - ? _listOfBooleanValue.toString() + ? _listOfBooleanValue!.toString() : "null") + ", "); buffer.write("awsDateValue=" + - (_awsDateValue != null ? _awsDateValue.format() : "null") + + (_awsDateValue != null ? _awsDateValue!.format() : "null") + ", "); buffer.write("listOfAWSDateValue=" + (_listOfAWSDateValue != null - ? _listOfAWSDateValue.toString() + ? _listOfAWSDateValue!.toString() : "null") + ", "); buffer.write("awsDateTimeValue=" + - (_awsDateTimeValue != null ? _awsDateTimeValue.format() : "null") + + (_awsDateTimeValue != null ? _awsDateTimeValue!.format() : "null") + ", "); buffer.write("listOfAWSDateTimeValue=" + (_listOfAWSDateTimeValue != null - ? _listOfAWSDateTimeValue.toString() + ? _listOfAWSDateTimeValue!.toString() : "null") + ", "); buffer.write("awsTimeValue=" + - (_awsTimeValue != null ? _awsTimeValue.format() : "null") + + (_awsTimeValue != null ? _awsTimeValue!.format() : "null") + ", "); buffer.write("listOfAWSTimeValue=" + (_listOfAWSTimeValue != null - ? _listOfAWSTimeValue.toString() + ? _listOfAWSTimeValue!.toString() : "null") + ", "); buffer.write("awsTimestampValue=" + - (_awsTimestampValue != null ? _awsTimestampValue.toString() : "null") + + (_awsTimestampValue != null ? _awsTimestampValue!.toString() : "null") + ", "); buffer.write("listOfAWSTimestampValue=" + (_listOfAWSTimestampValue != null - ? _listOfAWSTimestampValue.toString() + ? _listOfAWSTimestampValue!.toString() : "null") + ", "); buffer.write("awsEmailValue=" + "$_awsEmailValue" + ", "); buffer.write("listOfAWSEmailValue=" + (_listOfAWSEmailValue != null - ? _listOfAWSEmailValue.toString() + ? _listOfAWSEmailValue!.toString() : "null") + ", "); buffer.write("awsJsonValue=" + "$_awsJsonValue" + ", "); buffer.write("listOfAWSJsonValue=" + (_listOfAWSJsonValue != null - ? _listOfAWSJsonValue.toString() + ? _listOfAWSJsonValue!.toString() : "null") + ", "); buffer.write("awsPhoneValue=" + "$_awsPhoneValue" + ", "); buffer.write("listOfAWSPhoneValue=" + (_listOfAWSPhoneValue != null - ? _listOfAWSPhoneValue.toString() + ? _listOfAWSPhoneValue!.toString() : "null") + ", "); buffer.write("awsURLValue=" + "$_awsURLValue" + ", "); buffer.write("listOfAWSURLValue=" + - (_listOfAWSURLValue != null ? _listOfAWSURLValue.toString() : "null") + + (_listOfAWSURLValue != null ? _listOfAWSURLValue!.toString() : "null") + ", "); buffer.write("awsIPAddressValue=" + "$_awsIPAddressValue" + ", "); buffer.write("listOfAWSIPAddressValue=" + (_listOfAWSIPAddressValue != null - ? _listOfAWSIPAddressValue.toString() + ? _listOfAWSIPAddressValue!.toString() : "null") + ", "); buffer.write("enumValue=" + @@ -486,17 +486,17 @@ class CustomTypeWithAppsyncScalarTypes { ", "); buffer.write("listOfEnumValue=" + (_listOfEnumValue != null - ? _listOfEnumValue + ? _listOfEnumValue! .map((e) => amplify_core.enumToString(e)) .toString() : "null") + ", "); buffer.write("customTypeValue=" + - (_customTypeValue != null ? _customTypeValue.toString() : "null") + + (_customTypeValue != null ? _customTypeValue!.toString() : "null") + ", "); buffer.write("listOfCustomTypeValue=" + (_listOfCustomTypeValue != null - ? _listOfCustomTypeValue.toString() + ? _listOfCustomTypeValue!.toString() : "null")); buffer.write("}"); diff --git a/packages/amplify_datastore/example/lib/models/HasManyChildBiDirectionalExplicit.dart b/packages/amplify_datastore/example/lib/models/HasManyChildBiDirectionalExplicit.dart index 6c62ee0a37..150a6639db 100644 --- a/packages/amplify_datastore/example/lib/models/HasManyChildBiDirectionalExplicit.dart +++ b/packages/amplify_datastore/example/lib/models/HasManyChildBiDirectionalExplicit.dart @@ -100,13 +100,13 @@ class HasManyChildBiDirectionalExplicit extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("hasManyParent=" + - (_hasManyParent != null ? _hasManyParent.toString() : "null") + + (_hasManyParent != null ? _hasManyParent!.toString() : "null") + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/HasManyChildBiDirectionalImplicit.dart b/packages/amplify_datastore/example/lib/models/HasManyChildBiDirectionalImplicit.dart index 67eee845f7..aa2cbe4e49 100644 --- a/packages/amplify_datastore/example/lib/models/HasManyChildBiDirectionalImplicit.dart +++ b/packages/amplify_datastore/example/lib/models/HasManyChildBiDirectionalImplicit.dart @@ -100,13 +100,13 @@ class HasManyChildBiDirectionalImplicit extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("hasManyParent=" + - (_hasManyParent != null ? _hasManyParent.toString() : "null") + + (_hasManyParent != null ? _hasManyParent!.toString() : "null") + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/HasManyChildExplicit.dart b/packages/amplify_datastore/example/lib/models/HasManyChildExplicit.dart index 7b093ee152..3355ab6bd0 100644 --- a/packages/amplify_datastore/example/lib/models/HasManyChildExplicit.dart +++ b/packages/amplify_datastore/example/lib/models/HasManyChildExplicit.dart @@ -108,10 +108,10 @@ class HasManyChildExplicit extends amplify_core.Model { buffer.write("name=" + "$_name" + ", "); buffer.write("hasManyParentID=" + "$_hasManyParentID" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/HasManyChildImplicit.dart b/packages/amplify_datastore/example/lib/models/HasManyChildImplicit.dart index 499d945e3d..07b36026f3 100644 --- a/packages/amplify_datastore/example/lib/models/HasManyChildImplicit.dart +++ b/packages/amplify_datastore/example/lib/models/HasManyChildImplicit.dart @@ -103,10 +103,10 @@ class HasManyChildImplicit extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write("updatedAt=" + - (_updatedAt != null ? _updatedAt.format() : "null") + + (_updatedAt != null ? _updatedAt!.format() : "null") + ", "); buffer.write("hasManyParentImplicitChildrenId=" + "$_hasManyParentImplicitChildrenId"); diff --git a/packages/amplify_datastore/example/lib/models/HasManyParent.dart b/packages/amplify_datastore/example/lib/models/HasManyParent.dart index ee72775eaf..bea0d08098 100644 --- a/packages/amplify_datastore/example/lib/models/HasManyParent.dart +++ b/packages/amplify_datastore/example/lib/models/HasManyParent.dart @@ -121,10 +121,10 @@ class HasManyParent extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); @@ -159,32 +159,36 @@ class HasManyParent extends amplify_core.Model { HasManyParent.fromJson(Map json) : id = json['id'], _name = json['name'], - _implicitChildren = json['implicitChildren'] != null - ? json['implicitChildren'] is Map + _implicitChildren = json['implicitChildren'] is Map + ? (json['implicitChildren']['items'] is List ? (json['implicitChildren']['items'] as List) .where((e) => e != null) .map((e) => HasManyChildImplicit.fromJson( new Map.from(e))) .toList() - : (json['implicitChildren'] as List) + : null) + : (json['implicitChildren'] is List + ? (json['implicitChildren'] as List) .where((e) => e?['serializedData'] != null) .map((e) => HasManyChildImplicit.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, - _explicitChildren = json['explicitChildren'] != null - ? json['explicitChildren'] is Map + : null), + _explicitChildren = json['explicitChildren'] is Map + ? (json['explicitChildren']['items'] is List ? (json['explicitChildren']['items'] as List) .where((e) => e != null) .map((e) => HasManyChildExplicit.fromJson( new Map.from(e))) .toList() - : (json['explicitChildren'] as List) + : null) + : (json['explicitChildren'] is List + ? (json['explicitChildren'] as List) .where((e) => e?['serializedData'] != null) .map((e) => HasManyChildExplicit.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null, diff --git a/packages/amplify_datastore/example/lib/models/HasManyParentBiDirectionalExplicit.dart b/packages/amplify_datastore/example/lib/models/HasManyParentBiDirectionalExplicit.dart index 567dda590d..ed7651518e 100644 --- a/packages/amplify_datastore/example/lib/models/HasManyParentBiDirectionalExplicit.dart +++ b/packages/amplify_datastore/example/lib/models/HasManyParentBiDirectionalExplicit.dart @@ -109,10 +109,10 @@ class HasManyParentBiDirectionalExplicit extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); @@ -143,21 +143,22 @@ class HasManyParentBiDirectionalExplicit extends amplify_core.Model { HasManyParentBiDirectionalExplicit.fromJson(Map json) : id = json['id'], _name = json['name'], - _biDirectionalExplicitChildren = json[ - 'biDirectionalExplicitChildren'] != - null - ? json['biDirectionalExplicitChildren'] is Map + _biDirectionalExplicitChildren = json['biDirectionalExplicitChildren'] + is Map + ? (json['biDirectionalExplicitChildren']['items'] is List ? (json['biDirectionalExplicitChildren']['items'] as List) .where((e) => e != null) .map((e) => HasManyChildBiDirectionalExplicit.fromJson( new Map.from(e))) .toList() - : (json['biDirectionalExplicitChildren'] as List) + : null) + : (json['biDirectionalExplicitChildren'] is List + ? (json['biDirectionalExplicitChildren'] as List) .where((e) => e?['serializedData'] != null) .map((e) => HasManyChildBiDirectionalExplicit.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null, diff --git a/packages/amplify_datastore/example/lib/models/HasManyParentBiDirectionalImplicit.dart b/packages/amplify_datastore/example/lib/models/HasManyParentBiDirectionalImplicit.dart index f9bed12a79..5897f1a7ee 100644 --- a/packages/amplify_datastore/example/lib/models/HasManyParentBiDirectionalImplicit.dart +++ b/packages/amplify_datastore/example/lib/models/HasManyParentBiDirectionalImplicit.dart @@ -109,10 +109,10 @@ class HasManyParentBiDirectionalImplicit extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); @@ -143,21 +143,22 @@ class HasManyParentBiDirectionalImplicit extends amplify_core.Model { HasManyParentBiDirectionalImplicit.fromJson(Map json) : id = json['id'], _name = json['name'], - _biDirectionalImplicitChildren = json[ - 'biDirectionalImplicitChildren'] != - null - ? json['biDirectionalImplicitChildren'] is Map + _biDirectionalImplicitChildren = json['biDirectionalImplicitChildren'] + is Map + ? (json['biDirectionalImplicitChildren']['items'] is List ? (json['biDirectionalImplicitChildren']['items'] as List) .where((e) => e != null) .map((e) => HasManyChildBiDirectionalImplicit.fromJson( new Map.from(e))) .toList() - : (json['biDirectionalImplicitChildren'] as List) + : null) + : (json['biDirectionalImplicitChildren'] is List + ? (json['biDirectionalImplicitChildren'] as List) .where((e) => e?['serializedData'] != null) .map((e) => HasManyChildBiDirectionalImplicit.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null, diff --git a/packages/amplify_datastore/example/lib/models/HasOneChild.dart b/packages/amplify_datastore/example/lib/models/HasOneChild.dart index 2ff9c47c19..cc31fe87fd 100644 --- a/packages/amplify_datastore/example/lib/models/HasOneChild.dart +++ b/packages/amplify_datastore/example/lib/models/HasOneChild.dart @@ -85,10 +85,10 @@ class HasOneChild extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("name=" + "$_name" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/HasOneParent.dart b/packages/amplify_datastore/example/lib/models/HasOneParent.dart index af284e1900..4fd71e3631 100644 --- a/packages/amplify_datastore/example/lib/models/HasOneParent.dart +++ b/packages/amplify_datastore/example/lib/models/HasOneParent.dart @@ -135,10 +135,10 @@ class HasOneParent extends amplify_core.Model { buffer.write("name=" + "$_name" + ", "); buffer.write("explicitChildID=" + "$_explicitChildID" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write("updatedAt=" + - (_updatedAt != null ? _updatedAt.format() : "null") + + (_updatedAt != null ? _updatedAt!.format() : "null") + ", "); buffer.write( "hasOneParentImplicitChildId=" + "$_hasOneParentImplicitChildId"); diff --git a/packages/amplify_datastore/example/lib/models/ModelProvider.dart b/packages/amplify_datastore/example/lib/models/ModelProvider.dart index 6dc64f5bbb..1e83b4dea5 100644 --- a/packages/amplify_datastore/example/lib/models/ModelProvider.dart +++ b/packages/amplify_datastore/example/lib/models/ModelProvider.dart @@ -20,6 +20,7 @@ // ignore_for_file: public_member_api_docs, annotate_overrides, dead_code, dead_codepublic_member_api_docs, depend_on_referenced_packages, file_names, library_private_types_in_public_api, no_leading_underscores_for_library_prefixes, no_leading_underscores_for_local_identifiers, non_constant_identifier_names, null_check_on_nullable_type_parameter, prefer_adjacent_string_concatenation, prefer_const_constructors, prefer_if_null_operators, prefer_interpolation_to_compose_strings, slash_for_doc_comments, sort_child_properties_last, unnecessary_const, unnecessary_constructor_name, unnecessary_late, unnecessary_new, unnecessary_null_aware_assignments, unnecessary_nullable_for_final_variable_declarations, unnecessary_string_interpolations, use_build_context_synchronously import 'package:amplify_core/amplify_core.dart' as amplify_core; + import 'BelongsToChildExplicit.dart'; import 'BelongsToChildImplicit.dart'; import 'BelongsToParent.dart'; @@ -44,6 +45,7 @@ import 'CpkOneToOneBidirectionalChildImplicitID.dart'; import 'CpkOneToOneBidirectionalParentCD.dart'; import 'CpkOneToOneBidirectionalParentID.dart'; import 'CpkPostTags.dart'; +import 'CustomTypeWithAppsyncScalarTypes.dart'; import 'HasManyChildBiDirectionalExplicit.dart'; import 'HasManyChildBiDirectionalImplicit.dart'; import 'HasManyChildExplicit.dart'; @@ -61,9 +63,8 @@ import 'MultiRelatedMeeting.dart'; import 'MultiRelatedRegistration.dart'; import 'Post.dart'; import 'PostTags.dart'; -import 'Tag.dart'; -import 'CustomTypeWithAppsyncScalarTypes.dart'; import 'SimpleCustomType.dart'; +import 'Tag.dart'; export 'BelongsToChildExplicit.dart'; export 'BelongsToChildImplicit.dart'; @@ -116,45 +117,45 @@ class ModelProvider implements amplify_core.ModelProviderInterface { String version = "bc8b47d938d0b7deff50ac977653bed7"; @override List modelSchemas = [ - BelongsToChildExplicit.schema, - BelongsToChildImplicit.schema, - BelongsToParent.schema, + // BelongsToChildExplicit.schema, + // BelongsToChildImplicit.schema, + // BelongsToParent.schema, Blog.schema, Comment.schema, - CpkHasManyChildBidirectionalExplicit.schema, - CpkHasManyChildBidirectionalImplicit.schema, - CpkHasManyParentBidirectionalExplicit.schema, - CpkHasManyParentBidirectionalImplicit.schema, - CpkHasManyUnidirectionalChildExplicit.schema, - CpkHasManyUnidirectionalChildImplicit.schema, - CpkHasManyUnidirectionalParent.schema, - CpkHasOneUnidirectionalChild.schema, - CpkHasOneUnidirectionalParent.schema, - CpkInventory.schema, - CpkManyToManyPost.schema, - CpkManyToManyTag.schema, - CpkOneToOneBidirectionalChildExplicitCD.schema, - CpkOneToOneBidirectionalChildExplicitID.schema, - CpkOneToOneBidirectionalChildImplicitCD.schema, - CpkOneToOneBidirectionalChildImplicitID.schema, - CpkOneToOneBidirectionalParentCD.schema, - CpkOneToOneBidirectionalParentID.schema, - CpkPostTags.schema, - HasManyChildBiDirectionalExplicit.schema, - HasManyChildBiDirectionalImplicit.schema, - HasManyChildExplicit.schema, - HasManyChildImplicit.schema, - HasManyParent.schema, - HasManyParentBiDirectionalExplicit.schema, - HasManyParentBiDirectionalImplicit.schema, - HasOneChild.schema, - HasOneParent.schema, - ModelWithAppsyncScalarTypes.schema, - ModelWithCustomType.schema, - ModelWithEnum.schema, - MultiRelatedAttendee.schema, - MultiRelatedMeeting.schema, - MultiRelatedRegistration.schema, + // CpkHasManyChildBidirectionalExplicit.schema, + // CpkHasManyChildBidirectionalImplicit.schema, + // CpkHasManyParentBidirectionalExplicit.schema, + // CpkHasManyParentBidirectionalImplicit.schema, + // CpkHasManyUnidirectionalChildExplicit.schema, + // CpkHasManyUnidirectionalChildImplicit.schema, + // CpkHasManyUnidirectionalParent.schema, + // CpkHasOneUnidirectionalChild.schema, + // CpkHasOneUnidirectionalParent.schema, + // CpkInventory.schema, + // CpkManyToManyPost.schema, + // CpkManyToManyTag.schema, + // CpkOneToOneBidirectionalChildExplicitCD.schema, + // CpkOneToOneBidirectionalChildExplicitID.schema, + // CpkOneToOneBidirectionalChildImplicitCD.schema, + // CpkOneToOneBidirectionalChildImplicitID.schema, + // CpkOneToOneBidirectionalParentCD.schema, + // CpkOneToOneBidirectionalParentID.schema, + // CpkPostTags.schema, + // HasManyChildBiDirectionalExplicit.schema, + // HasManyChildBiDirectionalImplicit.schema, + // HasManyChildExplicit.schema, + // HasManyChildImplicit.schema, + // HasManyParent.schema, + // HasManyParentBiDirectionalExplicit.schema, + // HasManyParentBiDirectionalImplicit.schema, + // HasOneChild.schema, + // HasOneParent.schema, + // ModelWithAppsyncScalarTypes.schema, + // ModelWithCustomType.schema, + // ModelWithEnum.schema, + // MultiRelatedAttendee.schema, + // MultiRelatedMeeting.schema, + // MultiRelatedRegistration.schema, Post.schema, PostTags.schema, Tag.schema diff --git a/packages/amplify_datastore/example/lib/models/ModelWithAppsyncScalarTypes.dart b/packages/amplify_datastore/example/lib/models/ModelWithAppsyncScalarTypes.dart index 49d18a675f..79cc247eef 100644 --- a/packages/amplify_datastore/example/lib/models/ModelWithAppsyncScalarTypes.dart +++ b/packages/amplify_datastore/example/lib/models/ModelWithAppsyncScalarTypes.dart @@ -407,96 +407,96 @@ class ModelWithAppsyncScalarTypes extends amplify_core.Model { buffer.write("stringValue=" + "$_stringValue" + ", "); buffer.write("altStringValue=" + "$_altStringValue" + ", "); buffer.write("listOfStringValue=" + - (_listOfStringValue != null ? _listOfStringValue.toString() : "null") + + (_listOfStringValue != null ? _listOfStringValue!.toString() : "null") + ", "); buffer.write("intValue=" + - (_intValue != null ? _intValue.toString() : "null") + + (_intValue != null ? _intValue!.toString() : "null") + ", "); buffer.write("altIntValue=" + - (_altIntValue != null ? _altIntValue.toString() : "null") + + (_altIntValue != null ? _altIntValue!.toString() : "null") + ", "); buffer.write("listOfIntValue=" + - (_listOfIntValue != null ? _listOfIntValue.toString() : "null") + + (_listOfIntValue != null ? _listOfIntValue!.toString() : "null") + ", "); buffer.write("floatValue=" + - (_floatValue != null ? _floatValue.toString() : "null") + + (_floatValue != null ? _floatValue!.toString() : "null") + ", "); buffer.write("listOfFloatValue=" + - (_listOfFloatValue != null ? _listOfFloatValue.toString() : "null") + + (_listOfFloatValue != null ? _listOfFloatValue!.toString() : "null") + ", "); buffer.write("booleanValue=" + - (_booleanValue != null ? _booleanValue.toString() : "null") + + (_booleanValue != null ? _booleanValue!.toString() : "null") + ", "); buffer.write("listOfBooleanValue=" + (_listOfBooleanValue != null - ? _listOfBooleanValue.toString() + ? _listOfBooleanValue!.toString() : "null") + ", "); buffer.write("awsDateValue=" + - (_awsDateValue != null ? _awsDateValue.format() : "null") + + (_awsDateValue != null ? _awsDateValue!.format() : "null") + ", "); buffer.write("listOfAWSDateValue=" + (_listOfAWSDateValue != null - ? _listOfAWSDateValue.toString() + ? _listOfAWSDateValue!.toString() : "null") + ", "); buffer.write("awsTimeValue=" + - (_awsTimeValue != null ? _awsTimeValue.format() : "null") + + (_awsTimeValue != null ? _awsTimeValue!.format() : "null") + ", "); buffer.write("listOfAWSTimeValue=" + (_listOfAWSTimeValue != null - ? _listOfAWSTimeValue.toString() + ? _listOfAWSTimeValue!.toString() : "null") + ", "); buffer.write("awsDateTimeValue=" + - (_awsDateTimeValue != null ? _awsDateTimeValue.format() : "null") + + (_awsDateTimeValue != null ? _awsDateTimeValue!.format() : "null") + ", "); buffer.write("listOfAWSDateTimeValue=" + (_listOfAWSDateTimeValue != null - ? _listOfAWSDateTimeValue.toString() + ? _listOfAWSDateTimeValue!.toString() : "null") + ", "); buffer.write("awsTimestampValue=" + - (_awsTimestampValue != null ? _awsTimestampValue.toString() : "null") + + (_awsTimestampValue != null ? _awsTimestampValue!.toString() : "null") + ", "); buffer.write("listOfAWSTimestampValue=" + (_listOfAWSTimestampValue != null - ? _listOfAWSTimestampValue.toString() + ? _listOfAWSTimestampValue!.toString() : "null") + ", "); buffer.write("awsEmailValue=" + "$_awsEmailValue" + ", "); buffer.write("listOfAWSEmailValue=" + (_listOfAWSEmailValue != null - ? _listOfAWSEmailValue.toString() + ? _listOfAWSEmailValue!.toString() : "null") + ", "); buffer.write("awsJsonValue=" + "$_awsJsonValue" + ", "); buffer.write("listOfAWSJsonValue=" + (_listOfAWSJsonValue != null - ? _listOfAWSJsonValue.toString() + ? _listOfAWSJsonValue!.toString() : "null") + ", "); buffer.write("awsPhoneValue=" + "$_awsPhoneValue" + ", "); buffer.write("listOfAWSPhoneValue=" + (_listOfAWSPhoneValue != null - ? _listOfAWSPhoneValue.toString() + ? _listOfAWSPhoneValue!.toString() : "null") + ", "); buffer.write("awsURLValue=" + "$_awsURLValue" + ", "); buffer.write("listOfAWSURLValue=" + - (_listOfAWSURLValue != null ? _listOfAWSURLValue.toString() : "null") + + (_listOfAWSURLValue != null ? _listOfAWSURLValue!.toString() : "null") + ", "); buffer.write("awsIPAddressValue=" + "$_awsIPAddressValue" + ", "); buffer.write("listOfAWSIPAddressValue=" + (_listOfAWSIPAddressValue != null - ? _listOfAWSIPAddressValue.toString() + ? _listOfAWSIPAddressValue!.toString() : "null") + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/ModelWithCustomType.dart b/packages/amplify_datastore/example/lib/models/ModelWithCustomType.dart index c4b331997f..f918c59a6b 100644 --- a/packages/amplify_datastore/example/lib/models/ModelWithCustomType.dart +++ b/packages/amplify_datastore/example/lib/models/ModelWithCustomType.dart @@ -108,18 +108,18 @@ class ModelWithCustomType extends amplify_core.Model { buffer.write("ModelWithCustomType {"); buffer.write("id=" + "$id" + ", "); buffer.write("customTypeValue=" + - (_customTypeValue != null ? _customTypeValue.toString() : "null") + + (_customTypeValue != null ? _customTypeValue!.toString() : "null") + ", "); buffer.write("listOfCustomTypeValue=" + (_listOfCustomTypeValue != null - ? _listOfCustomTypeValue.toString() + ? _listOfCustomTypeValue!.toString() : "null") + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/ModelWithEnum.dart b/packages/amplify_datastore/example/lib/models/ModelWithEnum.dart index 6d698a1c03..1afcb1db7f 100644 --- a/packages/amplify_datastore/example/lib/models/ModelWithEnum.dart +++ b/packages/amplify_datastore/example/lib/models/ModelWithEnum.dart @@ -105,16 +105,16 @@ class ModelWithEnum extends amplify_core.Model { ", "); buffer.write("listOfEnumField=" + (_listOfEnumField != null - ? _listOfEnumField + ? _listOfEnumField! .map((e) => amplify_core.enumToString(e)) .toString() : "null") + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/MultiRelatedAttendee.dart b/packages/amplify_datastore/example/lib/models/MultiRelatedAttendee.dart index 77f7f33b26..adfb18d73b 100644 --- a/packages/amplify_datastore/example/lib/models/MultiRelatedAttendee.dart +++ b/packages/amplify_datastore/example/lib/models/MultiRelatedAttendee.dart @@ -92,10 +92,10 @@ class MultiRelatedAttendee extends amplify_core.Model { buffer.write("MultiRelatedAttendee {"); buffer.write("id=" + "$id" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); @@ -114,19 +114,21 @@ class MultiRelatedAttendee extends amplify_core.Model { MultiRelatedAttendee.fromJson(Map json) : id = json['id'], - _meetings = json['meetings'] != null - ? json['meetings'] is Map + _meetings = json['meetings'] is Map + ? (json['meetings']['items'] is List ? (json['meetings']['items'] as List) .where((e) => e != null) .map((e) => MultiRelatedRegistration.fromJson( new Map.from(e))) .toList() - : (json['meetings'] as List) + : null) + : (json['meetings'] is List + ? (json['meetings'] as List) .where((e) => e?['serializedData'] != null) .map((e) => MultiRelatedRegistration.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null, diff --git a/packages/amplify_datastore/example/lib/models/MultiRelatedMeeting.dart b/packages/amplify_datastore/example/lib/models/MultiRelatedMeeting.dart index 88d4a66ce5..cc4ead9f46 100644 --- a/packages/amplify_datastore/example/lib/models/MultiRelatedMeeting.dart +++ b/packages/amplify_datastore/example/lib/models/MultiRelatedMeeting.dart @@ -112,10 +112,10 @@ class MultiRelatedMeeting extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("title=" + "$_title" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); @@ -141,19 +141,21 @@ class MultiRelatedMeeting extends amplify_core.Model { MultiRelatedMeeting.fromJson(Map json) : id = json['id'], _title = json['title'], - _attendees = json['attendees'] != null - ? json['attendees'] is Map + _attendees = json['attendees'] is Map + ? (json['attendees']['items'] is List ? (json['attendees']['items'] as List) .where((e) => e != null) .map((e) => MultiRelatedRegistration.fromJson( new Map.from(e))) .toList() - : (json['attendees'] as List) + : null) + : (json['attendees'] is List + ? (json['attendees'] as List) .where((e) => e?['serializedData'] != null) .map((e) => MultiRelatedRegistration.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null, diff --git a/packages/amplify_datastore/example/lib/models/MultiRelatedRegistration.dart b/packages/amplify_datastore/example/lib/models/MultiRelatedRegistration.dart index 2b77ee2d7d..2ce3c7e087 100644 --- a/packages/amplify_datastore/example/lib/models/MultiRelatedRegistration.dart +++ b/packages/amplify_datastore/example/lib/models/MultiRelatedRegistration.dart @@ -121,15 +121,15 @@ class MultiRelatedRegistration extends amplify_core.Model { buffer.write("MultiRelatedRegistration {"); buffer.write("id=" + "$id" + ", "); buffer.write( - "meeting=" + (_meeting != null ? _meeting.toString() : "null") + ", "); + "meeting=" + (_meeting != null ? _meeting!.toString() : "null") + ", "); buffer.write("attendee=" + - (_attendee != null ? _attendee.toString() : "null") + + (_attendee != null ? _attendee!.toString() : "null") + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/Post.dart b/packages/amplify_datastore/example/lib/models/Post.dart index 6df35b9c41..2db6a54c08 100644 --- a/packages/amplify_datastore/example/lib/models/Post.dart +++ b/packages/amplify_datastore/example/lib/models/Post.dart @@ -164,15 +164,15 @@ class Post extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("title=" + "$_title" + ", "); buffer.write( - "rating=" + (_rating != null ? _rating.toString() : "null") + ", "); + "rating=" + (_rating != null ? _rating!.toString() : "null") + ", "); buffer.write( - "created=" + (_created != null ? _created.format() : "null") + ", "); - buffer.write("blog=" + (_blog != null ? _blog.toString() : "null") + ", "); + "created=" + (_created != null ? _created!.format() : "null") + ", "); + buffer.write("blog=" + (_blog != null ? _blog!.toString() : "null") + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); @@ -225,32 +225,36 @@ class Post extends amplify_core.Model { json['blog']['serializedData'])) : Blog.fromJson(new Map.from(json['blog'])) : null, - _comments = json['comments'] != null - ? json['comments'] is Map + _comments = json['comments'] is Map + ? (json['comments']['items'] is List ? (json['comments']['items'] as List) .where((e) => e != null) .map((e) => Comment.fromJson(new Map.from(e))) .toList() - : (json['comments'] as List) + : null) + : (json['comments'] is List + ? (json['comments'] as List) .where((e) => e?['serializedData'] != null) .map((e) => Comment.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, - _tags = json['tags'] != null - ? json['tags'] is Map + : null), + _tags = json['tags'] is Map + ? (json['tags']['items'] is List ? (json['tags']['items'] as List) .where((e) => e != null) .map((e) => PostTags.fromJson(new Map.from(e))) .toList() - : (json['tags'] as List) + : null) + : (json['tags'] is List + ? (json['tags'] as List) .where((e) => e?['serializedData'] != null) .map((e) => PostTags.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null, diff --git a/packages/amplify_datastore/example/lib/models/PostTags.dart b/packages/amplify_datastore/example/lib/models/PostTags.dart index 240fd3231c..f37279e59f 100644 --- a/packages/amplify_datastore/example/lib/models/PostTags.dart +++ b/packages/amplify_datastore/example/lib/models/PostTags.dart @@ -113,13 +113,13 @@ class PostTags extends amplify_core.Model { buffer.write("PostTags {"); buffer.write("id=" + "$id" + ", "); - buffer.write("post=" + (_post != null ? _post.toString() : "null") + ", "); - buffer.write("tag=" + (_tag != null ? _tag.toString() : "null") + ", "); + buffer.write("post=" + (_post != null ? _post!.toString() : "null") + ", "); + buffer.write("tag=" + (_tag != null ? _tag!.toString() : "null") + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); diff --git a/packages/amplify_datastore/example/lib/models/Tag.dart b/packages/amplify_datastore/example/lib/models/Tag.dart index 2c61f9a49a..ae2168a7e7 100644 --- a/packages/amplify_datastore/example/lib/models/Tag.dart +++ b/packages/amplify_datastore/example/lib/models/Tag.dart @@ -107,10 +107,10 @@ class Tag extends amplify_core.Model { buffer.write("id=" + "$id" + ", "); buffer.write("label=" + "$_label" + ", "); buffer.write("createdAt=" + - (_createdAt != null ? _createdAt.format() : "null") + + (_createdAt != null ? _createdAt!.format() : "null") + ", "); buffer.write( - "updatedAt=" + (_updatedAt != null ? _updatedAt.format() : "null")); + "updatedAt=" + (_updatedAt != null ? _updatedAt!.format() : "null")); buffer.write("}"); return buffer.toString(); @@ -133,19 +133,21 @@ class Tag extends amplify_core.Model { Tag.fromJson(Map json) : id = json['id'], _label = json['label'], - _posts = json['posts'] != null - ? json['posts'] is Map + _posts = json['posts'] is Map + ? (json['posts']['items'] is List ? (json['posts']['items'] as List) .where((e) => e != null) .map((e) => PostTags.fromJson(new Map.from(e))) .toList() - : (json['posts'] as List) + : null) + : (json['posts'] is List + ? (json['posts'] as List) .where((e) => e?['serializedData'] != null) .map((e) => PostTags.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null, diff --git a/packages/api/amplify_api/example/lib/models/Blog.dart b/packages/api/amplify_api/example/lib/models/Blog.dart index 76f1f28b57..0c69c66f89 100644 --- a/packages/api/amplify_api/example/lib/models/Blog.dart +++ b/packages/api/amplify_api/example/lib/models/Blog.dart @@ -132,18 +132,20 @@ class Blog extends amplify_core.Model { Blog.fromJson(Map json) : id = json['id'], _name = json['name'], - _posts = json['posts'] != null - ? json['posts'] is Map + _posts = json['posts'] is Map + ? (json['posts']['items'] is List ? (json['posts']['items'] as List) .where((e) => e != null) .map((e) => Post.fromJson(new Map.from(e))) .toList() - : (json['posts'] as List) + : null) + : (json['posts'] is List + ? (json['posts'] as List) .where((e) => e?['serializedData'] != null) .map((e) => Post.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null, diff --git a/packages/api/amplify_api/example/lib/models/Post.dart b/packages/api/amplify_api/example/lib/models/Post.dart index 8aaa2dd49d..2b2a70b17e 100644 --- a/packages/api/amplify_api/example/lib/models/Post.dart +++ b/packages/api/amplify_api/example/lib/models/Post.dart @@ -189,19 +189,21 @@ class Post extends amplify_core.Model { json['blog']['serializedData'])) : Blog.fromJson(new Map.from(json['blog'])) : null, - _comments = json['comments'] != null - ? json['comments'] is Map + _comments = json['comments'] is Map + ? (json['comments']['items'] is List ? (json['comments']['items'] as List) .where((e) => e != null) .map((e) => Comment.fromJson(new Map.from(e))) .toList() - : (json['comments'] as List) + : null) + : (json['comments'] is List + ? (json['comments'] as List) .where((e) => e?['serializedData'] != null) .map((e) => Comment.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null, diff --git a/packages/api/amplify_api_dart/test/test_models/Blog.dart b/packages/api/amplify_api_dart/test/test_models/Blog.dart index 8ac3e6c5f0..d44cda2f11 100644 --- a/packages/api/amplify_api_dart/test/test_models/Blog.dart +++ b/packages/api/amplify_api_dart/test/test_models/Blog.dart @@ -132,18 +132,20 @@ class Blog extends amplify_core.Model { Blog.fromJson(Map json) : id = json['id'], _name = json['name'], - _posts = json['posts'] != null - ? json['posts'] is Map + _posts = json['posts'] is Map + ? (json['posts']['items'] is List ? (json['posts']['items'] as List) .where((e) => e != null) .map((e) => Post.fromJson(new Map.from(e))) .toList() - : (json['posts'] as List) + : null) + : (json['posts'] is List + ? (json['posts'] as List) .where((e) => e?['serializedData'] != null) .map((e) => Post.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null, diff --git a/packages/api/amplify_api_dart/test/test_models/Post.dart b/packages/api/amplify_api_dart/test/test_models/Post.dart index 66a1b7c89c..2db6a54c08 100644 --- a/packages/api/amplify_api_dart/test/test_models/Post.dart +++ b/packages/api/amplify_api_dart/test/test_models/Post.dart @@ -225,32 +225,36 @@ class Post extends amplify_core.Model { json['blog']['serializedData'])) : Blog.fromJson(new Map.from(json['blog'])) : null, - _comments = json['comments'] != null - ? json['comments'] is Map + _comments = json['comments'] is Map + ? (json['comments']['items'] is List ? (json['comments']['items'] as List) .where((e) => e != null) .map((e) => Comment.fromJson(new Map.from(e))) .toList() - : (json['comments'] as List) + : null) + : (json['comments'] is List + ? (json['comments'] as List) .where((e) => e?['serializedData'] != null) .map((e) => Comment.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, - _tags = json['tags'] != null - ? json['tags'] is Map + : null), + _tags = json['tags'] is Map + ? (json['tags']['items'] is List ? (json['tags']['items'] as List) .where((e) => e != null) .map((e) => PostTags.fromJson(new Map.from(e))) .toList() - : (json['tags'] as List) + : null) + : (json['tags'] is List + ? (json['tags'] as List) .where((e) => e?['serializedData'] != null) .map((e) => PostTags.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null, diff --git a/packages/api/amplify_api_dart/test/test_models/Tag.dart b/packages/api/amplify_api_dart/test/test_models/Tag.dart index 7897487b6e..ae2168a7e7 100644 --- a/packages/api/amplify_api_dart/test/test_models/Tag.dart +++ b/packages/api/amplify_api_dart/test/test_models/Tag.dart @@ -133,19 +133,21 @@ class Tag extends amplify_core.Model { Tag.fromJson(Map json) : id = json['id'], _label = json['label'], - _posts = json['posts'] != null - ? json['posts'] is Map + _posts = json['posts'] is Map + ? (json['posts']['items'] is List ? (json['posts']['items'] as List) .where((e) => e != null) .map((e) => PostTags.fromJson(new Map.from(e))) .toList() - : (json['posts'] as List) + : null) + : (json['posts'] is List + ? (json['posts'] as List) .where((e) => e?['serializedData'] != null) .map((e) => PostTags.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null, diff --git a/packages/api/amplify_api_dart/test/test_models/many_to_many/ManyToManyPrimary.dart b/packages/api/amplify_api_dart/test/test_models/many_to_many/ManyToManyPrimary.dart index 81bebdc770..04dfc3d52a 100644 --- a/packages/api/amplify_api_dart/test/test_models/many_to_many/ManyToManyPrimary.dart +++ b/packages/api/amplify_api_dart/test/test_models/many_to_many/ManyToManyPrimary.dart @@ -169,32 +169,36 @@ class ManyToManyPrimary extends amplify_core.Model { ManyToManyPrimary.fromJson(Map json) : id = json['id'], _name = json['name'], - _firstMtmToSecondary = json['firstMtmToSecondary'] != null - ? json['firstMtmToSecondary'] is Map + _firstMtmToSecondary = json['firstMtmToSecondary'] is Map + ? (json['firstMtmToSecondary']['items'] is List ? (json['firstMtmToSecondary']['items'] as List) .where((e) => e != null) .map((e) => FirstMtmRelation.fromJson( new Map.from(e))) .toList() - : (json['firstMtmToSecondary'] as List) + : null) + : (json['firstMtmToSecondary'] is List + ? (json['firstMtmToSecondary'] as List) .where((e) => e?['serializedData'] != null) .map((e) => FirstMtmRelation.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, - _secondMtmToSecondary = json['secondMtmToSecondary'] != null - ? json['secondMtmToSecondary'] is Map + : null), + _secondMtmToSecondary = json['secondMtmToSecondary'] is Map + ? (json['secondMtmToSecondary']['items'] is List ? (json['secondMtmToSecondary']['items'] as List) .where((e) => e != null) .map((e) => SecondMtmRelation.fromJson( new Map.from(e))) .toList() - : (json['secondMtmToSecondary'] as List) + : null) + : (json['secondMtmToSecondary'] is List + ? (json['secondMtmToSecondary'] as List) .where((e) => e?['serializedData'] != null) .map((e) => SecondMtmRelation.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null, diff --git a/packages/api/amplify_api_dart/test/test_models/many_to_many/ManyToManySecondary.dart b/packages/api/amplify_api_dart/test/test_models/many_to_many/ManyToManySecondary.dart index 78665b0350..3e62ac6b32 100644 --- a/packages/api/amplify_api_dart/test/test_models/many_to_many/ManyToManySecondary.dart +++ b/packages/api/amplify_api_dart/test/test_models/many_to_many/ManyToManySecondary.dart @@ -168,32 +168,36 @@ class ManyToManySecondary extends amplify_core.Model { ManyToManySecondary.fromJson(Map json) : id = json['id'], _name = json['name'], - _firstMtmToPrimary = json['firstMtmToPrimary'] != null - ? json['firstMtmToPrimary'] is Map + _firstMtmToPrimary = json['firstMtmToPrimary'] is Map + ? (json['firstMtmToPrimary']['items'] is List ? (json['firstMtmToPrimary']['items'] as List) .where((e) => e != null) .map((e) => FirstMtmRelation.fromJson( new Map.from(e))) .toList() - : (json['firstMtmToPrimary'] as List) + : null) + : (json['firstMtmToPrimary'] is List + ? (json['firstMtmToPrimary'] as List) .where((e) => e?['serializedData'] != null) .map((e) => FirstMtmRelation.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, - _secondMtmToPrimary = json['secondMtmToPrimary'] != null - ? json['secondMtmToPrimary'] is Map + : null), + _secondMtmToPrimary = json['secondMtmToPrimary'] is Map + ? (json['secondMtmToPrimary']['items'] is List ? (json['secondMtmToPrimary']['items'] as List) .where((e) => e != null) .map((e) => SecondMtmRelation.fromJson( new Map.from(e))) .toList() - : (json['secondMtmToPrimary'] as List) + : null) + : (json['secondMtmToPrimary'] is List + ? (json['secondMtmToPrimary'] as List) .where((e) => e?['serializedData'] != null) .map((e) => SecondMtmRelation.fromJson( new Map.from(e?['serializedData']))) .toList() - : null, + : null), _createdAt = json['createdAt'] != null ? amplify_core.TemporalDateTime.fromString(json['createdAt']) : null,