{"action":"opened","issue":{"url":"https://api.github.com/repos/dart-lang/json_serializable/issues/256","repository_url":"https://api.github.com/repos/dart-lang/json_serializable","labels_url":"https://api.github.com/repos/dart-lang/json_serializable/issues/256/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/json_serializable/issues/256/comments","events_url":"https://api.github.com/repos/dart-lang/json_serializable/issues/256/events","html_url":"https://github.com/dart-lang/json_serializable/issues/256","id":339838514,"node_id":"MDU6SXNzdWUzMzk4Mzg1MTQ=","number":256,"title":"When extend with an real class (not Object), got the error \"The class 'TumblrPostEntity' doesn't have an unnamed constructor.\".","user":{"login":"jaggerwang","id":1255011,"node_id":"MDQ6VXNlcjEyNTUwMTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1255011?v=4","gravatar_id":"","url":"https://api.github.com/users/jaggerwang","html_url":"https://github.com/jaggerwang","followers_url":"https://api.github.com/users/jaggerwang/followers","following_url":"https://api.github.com/users/jaggerwang/following{/other_user}","gists_url":"https://api.github.com/users/jaggerwang/gists{/gist_id}","starred_url":"https://api.github.com/users/jaggerwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaggerwang/subscriptions","organizations_url":"https://api.github.com/users/jaggerwang/orgs","repos_url":"https://api.github.com/users/jaggerwang/repos","events_url":"https://api.github.com/users/jaggerwang/events{/privacy}","received_events_url":"https://api.github.com/users/jaggerwang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-10T13:18:32Z","updated_at":"2018-07-10T13:18:32Z","closed_at":null,"author_association":"NONE","body":"## Problem\r\n\r\nAs the title. All the examples are using class extends from Object, so I have no reference.\r\n\r\n```\r\nThe class 'TumblrPostEntity' doesn't have an unnamed constructor.\r\n```\r\n\r\n## Code\r\n\r\n```dart\r\nimport 'package:meta/meta.dart';\r\nimport 'package:json_annotation/json_annotation.dart';\r\n\r\npart 'tumblr_post.g.dart';\r\n\r\n@JsonSerializable()\r\n@immutable\r\nclass TumblrPostEntity extends Object with _$TumblrPostEntitySerializerMixin {\r\n  final int id;\r\n  final String url;\r\n  final String shortUrl;\r\n  final String type;\r\n  final String format;\r\n  final List<String> tags;\r\n  final String reblogKey;\r\n  final _TumblrPostSource source;\r\n  final bool isLiked;\r\n  final String creator;\r\n  final DateTime postAt;\r\n\r\n  TumblrPostEntity({\r\n    this.id = 0,\r\n    this.url = '',\r\n    this.shortUrl = '',\r\n    this.type = '',\r\n    this.format = '',\r\n    this.tags = const [],\r\n    this.reblogKey = '',\r\n    source,\r\n    this.isLiked = false,\r\n    this.creator = '',\r\n    postAt,\r\n  })  : this.source = source ?? _TumblrPostSource(),\r\n        this.postAt = postAt ?? DateTime.fromMillisecondsSinceEpoch(0);\r\n\r\n  factory TumblrPostEntity.fromJson(Map<String, dynamic> json) =>\r\n      _$TumblrPostEntityFromJson(json);\r\n\r\n  @override\r\n  String toString() => 'TumblrPostEntity${toJson()}';\r\n}\r\n\r\n@JsonSerializable()\r\n@immutable\r\nclass _TumblrPostSource extends Object with _$_TumblrPostSourceSerializerMixin {\r\n  final String title;\r\n  final String url;\r\n\r\n  _TumblrPostSource({\r\n    this.title = '',\r\n    this.url = '',\r\n  });\r\n\r\n  factory _TumblrPostSource.fromJson(Map<String, dynamic> json) =>\r\n      _$_TumblrPostSourceFromJson(json);\r\n\r\n  @override\r\n  String toString() => '_TumblrPostSource${toJson()}';\r\n}\r\n\r\n@JsonSerializable()\r\n@immutable\r\nclass TumblrTextPostEntity extends TumblrPostEntity\r\n    with _$TumblrTextPostEntitySerializerMixin {\r\n  final String title;\r\n  final String body;\r\n\r\n  TumblrTextPostEntity({\r\n    id = '',\r\n    url = '',\r\n    shortUrl = '',\r\n    type = '',\r\n    format = '',\r\n    tags = const [],\r\n    reblogKey = '',\r\n    source = 0,\r\n    isLiked = false,\r\n    creator = '',\r\n    postAt,\r\n    this.title = '',\r\n    this.body = '',\r\n  }) : super(\r\n          id: id,\r\n          url: url,\r\n          shortUrl: shortUrl,\r\n          type: type,\r\n          format: format,\r\n          tags: tags,\r\n          reblogKey: reblogKey,\r\n          source: source,\r\n          isLiked: isLiked,\r\n          creator: creator,\r\n          postAt: postAt,\r\n        );\r\n\r\n  factory TumblrTextPostEntity.fromJson(Map<String, dynamic> json) =>\r\n      _$TumblrTextPostEntityFromJson(json);\r\n\r\n  @override\r\n  String toString() => 'TumblrTextPostEntity${toJson()}';\r\n}\r\n```"}}
{"actor":{"display_login":"jaggerwang"}}