Skip to content

Instantly share code, notes, and snippets.

@marcossevilla
Created February 4, 2021 17:28
Show Gist options
  • Save marcossevilla/c4656972050f915d3781d6e6cb24e862 to your computer and use it in GitHub Desktop.
Save marcossevilla/c4656972050f915d3781d6e6cb24e862 to your computer and use it in GitHub Desktop.
import 'package:json_annotation/json_annotation.dart';
import 'package:meta/meta.dart';
import 'store_item_equatable.dart';
part 'store_item_model.g.dart';
@JsonSerializable(nullable: false)
class StoreItemModel extends StoreItemEquatable {
StoreItemModel({
@required int id,
@required String name,
}) : super(id: id, name: name);
factory StoreItemModel.fromJson(Map<String, dynamic> json) {
return _$StoreItemModelFromJson(json);
}
Map<String, dynamic> toJson() => _$StoreItemModelToJson(this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment