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