import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; part 'item.g.dart'; @JsonSerializable() class Item extends Equatable { factory Item.fromJson(final Map json) => _$ItemFromJson(json); Item({ required this.title, required this.id, this.description, this.price, this.quantity, }); final String title; final String? description; final int? price; final int id; final int? quantity; // tojson Map toJson() => _$ItemToJson(this); @override List get props => [ title, description, price, id, quantity, ]; }