parent
17c93d0b2a
commit
d332bb90d2
@ -0,0 +1,22 @@
|
|||||||
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
import 'package:equatable/equatable.dart';
|
||||||
|
part 'exclude_phone_model.g.dart';
|
||||||
|
|
||||||
|
|
||||||
|
@JsonSerializable()
|
||||||
|
class ExcludePhoneModel extends Equatable{
|
||||||
|
final int id;
|
||||||
|
final String phone;
|
||||||
|
final String remark;
|
||||||
|
factory ExcludePhoneModel.fromJson(Map<String, dynamic> json) =>_$ExcludePhoneModelFromJson(json);
|
||||||
|
Map<String,dynamic> toJson()=> _$ExcludePhoneModelToJson(this);
|
||||||
|
|
||||||
|
const ExcludePhoneModel({
|
||||||
|
required this.id,
|
||||||
|
required this.phone,
|
||||||
|
required this.remark,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object?> get props => [id,phone,remark];
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'exclude_phone_model.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
ExcludePhoneModel _$ExcludePhoneModelFromJson(Map<String, dynamic> json) => ExcludePhoneModel(
|
||||||
|
id: json['id'] as int,
|
||||||
|
phone: json['phone'] as String,
|
||||||
|
remark: json['remark'] as String,
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$ExcludePhoneModelToJson(ExcludePhoneModel instance) => <String, dynamic>{
|
||||||
|
'id': instance.id,
|
||||||
|
'phone': instance.phone,
|
||||||
|
'remark': instance.remark,
|
||||||
|
};
|
@ -1,41 +1,37 @@
|
|||||||
import 'package:equatable/equatable.dart';
|
import 'package:equatable/equatable.dart';
|
||||||
import 'package:json_annotation/json_annotation.dart';
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
part 'login_info_model.g.dart';
|
|
||||||
|
|
||||||
|
part 'login_info_model.g.dart';
|
||||||
|
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class LoginInfo extends Equatable {
|
class LoginInfo extends Equatable {
|
||||||
final String token;
|
final String token;
|
||||||
final User user;
|
final User user;
|
||||||
|
|
||||||
factory LoginInfo.fromJson(Map<String, dynamic> json) =>
|
factory LoginInfo.fromJson(Map<String, dynamic> json) =>
|
||||||
_$LoginInfoFromJson(json);
|
_$LoginInfoFromJson(json);
|
||||||
|
|
||||||
const LoginInfo({
|
const LoginInfo({
|
||||||
required this.token,
|
required this.token,
|
||||||
required this.user,
|
required this.user,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object?> get props => [token, user];
|
List<Object?> get props => [token, user];
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class User extends Equatable {
|
class User extends Equatable {
|
||||||
final int id;
|
final int id;
|
||||||
final String name;
|
final String name;
|
||||||
|
|
||||||
const User({
|
const User({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.name,
|
required this.name,
|
||||||
});
|
});
|
||||||
|
|
||||||
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
|
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object?> get props =>
|
List<Object?> get props => [id, name];
|
||||||
[
|
|
||||||
id,
|
|
||||||
name,
|
|
||||||
];
|
|
||||||
}
|
}
|
Loading…
Reference in new issue