Skip to content

Issue converting from Timestamp and DateTime #11

@jpdata

Description

@jpdata

If model have a Timestamp property, modeler produces something like this:

  factory Comment.fromJson(Map<String, dynamic> json) {
    return Comment(
        content: (json['content']) as String,
        createdAt: DateTime.parse((json['createdAt'])),
        author_name: (json['author_name']) as String,
        author_email: (json['author_email']) as String);
  }

Will throw an error: Error: TypeError: Instance of 'Timestamp': type 'Timestamp' is not a subtype of type 'String'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions