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:json_annotation/json_annotation.dart';
|
||||
part 'login_info_model.g.dart';
|
||||
|
||||
part 'login_info_model.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class LoginInfo extends Equatable {
|
||||
final String token;
|
||||
final User user;
|
||||
final String token;
|
||||
final User user;
|
||||
|
||||
factory LoginInfo.fromJson(Map<String, dynamic> json) =>
|
||||
_$LoginInfoFromJson(json);
|
||||
factory LoginInfo.fromJson(Map<String, dynamic> json) =>
|
||||
_$LoginInfoFromJson(json);
|
||||
|
||||
const LoginInfo({
|
||||
required this.token,
|
||||
required this.user,
|
||||
});
|
||||
const LoginInfo({
|
||||
required this.token,
|
||||
required this.user,
|
||||
});
|
||||
|
||||
@override
|
||||
List<Object?> get props => [token, user];
|
||||
@override
|
||||
List<Object?> get props => [token, user];
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class User extends Equatable {
|
||||
final int id;
|
||||
final String name;
|
||||
|
||||
const User({
|
||||
required this.id,
|
||||
required this.name,
|
||||
});
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
|
||||
|
||||
@override
|
||||
List<Object?> get props =>
|
||||
[
|
||||
id,
|
||||
name,
|
||||
];
|
||||
}
|
||||
final int id;
|
||||
final String name;
|
||||
|
||||
const User({
|
||||
required this.id,
|
||||
required this.name,
|
||||
});
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [id, name];
|
||||
}
|
||||
|
Loading…
Reference in new issue