import 'package:equatable/equatable.dart'; class Booth extends Equatable { int id; String name; String code; Booth({required this.name, required this.id, required this.code}); Booth.fromJson(Map json) : id = json['id'].runtimeType == int ? json['id'] : int.parse(json['id']), name = json['name'], code = json['code']; Map toJson() => {'name': name, 'id': id, 'code': code}; @override List get props => [id]; }