Skip to content

Instantly share code, notes, and snippets.

@Abdulsametileri
Created February 11, 2021 09:36
Show Gist options
  • Save Abdulsametileri/3f664f95350a3babb3024e17cb7a9d25 to your computer and use it in GitHub Desktop.
Save Abdulsametileri/3f664f95350a3babb3024e17cb7a9d25 to your computer and use it in GitHub Desktop.
import 'package:json_annotation/json_annotation.dart';
part 'card_model.g.dart';
@JsonSerializable(fieldRename: FieldRename.snake)
class CardModel {
String id;
String author;
int width;
int height;
String url;
String downloadUrl;
CardModel({
this.id,
this.author,
this.width,
this.height,
this.url,
this.downloadUrl,
});
CardModel fromJson(Map<String, Object> json) => _$CardModelFromJson(json);
factory CardModel.fromJson(Map<String, Object> json) => _$CardModelFromJson(json);
Map<String, Object> toJson() => _$CardModelToJson(this);
}
class PaginationModel {
int page;
int limit;
PaginationModel({this.page, this.limit});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment