course-work/lib/models/courier.dart

34 lines
636 B
Dart
Raw Normal View History

2022-12-27 05:13:07 +00:00
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
part 'courier.g.dart';
@JsonSerializable()
class Courier extends Equatable {
factory Courier.fromJson(final Map<String, dynamic> json) =>
_$CourierFromJson(json);
Courier({
required this.name,
required this.surname,
required this.id,
required this.phone,
});
final String name;
final String surname;
final String phone;
final int id;
2022-12-27 05:13:07 +00:00
// tojson
Map<String, dynamic> toJson() => _$CourierToJson(this);
@override
List<Object?> get props => [
name,
surname,
phone,
id,
];
}