course-work/lib/models/courier.dart

34 lines
656 B
Dart

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;
// tojson
Map<String, dynamic> toJson() => _$CourierToJson(this);
@override
List<Object?> get props => [
name,
surname,
phone,
id,
];
}