Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Importing Json package
- library app_entry;
- import 'package:json_annotation/json_annotation.dart';
- part 'app_entry.g.dart';
- //annotation for the code generator to know that this class needs the
- // JSON serialization logic to be generated.
- @JsonSerializable
- class AppEntry extends Object with _$AppEntrySerializerMixin(){
- @JsonKey(nullable: true)
- final String name;
- @JsonKey(nullable: true)
- final String imgUrl;
- @JsonKey(nullable: true)
- final String marketUrl;
- //@JsonKey(includeIfNull: true)
- @JsonKey(nullable: true)
- final String summary;
- AppEntry(this.name, this.imgUrl, this.marketUrl, this.summary);
- factory AppEntry.fromJson(Map<String, dynamic> json) => _$AppEntrySerializableFromJson(json);
- Map<String, dynamic> toJson() => _$AppEntrySerializableToJson(this);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement