parent
6195daa49c
commit
c5feb7e9b7
@ -1,21 +0,0 @@
|
||||
class ConvenientPhoneModel {
|
||||
int? id;
|
||||
String? name;
|
||||
String? tel;
|
||||
|
||||
ConvenientPhoneModel({this.id, this.name, this.tel});
|
||||
|
||||
ConvenientPhoneModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
tel = json['tel'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['name'] = this.name;
|
||||
data['tel'] = this.tel;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
part 'convenience_phone_model.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable()
|
||||
class ConveniencePhoneModel extends Equatable {
|
||||
final int id;
|
||||
final String name;
|
||||
final String tel;
|
||||
final int type;
|
||||
|
||||
factory ConveniencePhoneModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$ConveniencePhoneModelFromJson(json);
|
||||
|
||||
const ConveniencePhoneModel({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.tel,
|
||||
required this.type,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [id, name, tel, type,];
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'convenience_phone_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ConveniencePhoneModel _$ConveniencePhoneModelFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
ConveniencePhoneModel(
|
||||
id: json['id'] as int,
|
||||
name: json['name'] as String,
|
||||
tel: json['tel'] as String,
|
||||
type: json['type'] as int,
|
||||
);
|
Loading…
Reference in new issue