| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- import 'package:json_annotation/json_annotation.dart';
- import 'location_info.dart';
- part 'user_info.g.dart';
- @JsonSerializable()
- class UserInfo {
- @JsonKey(name: 'friendId')
- final String id;
- @JsonKey(name: 'phone')
- final String phoneNumber;
- @JsonKey(name: 'remark')
- String? remark;
- @JsonKey(name: 'timestamp')
- final int? timestamp;
- @JsonKey(name: 'blockedHim')
- final bool? blockedHim;
- @JsonKey(name: 'blockedMe')
- final bool? blockedMe;
- @JsonKey(name: 'location')
- final LocationInfo? lastLocation;
- @JsonKey(name: 'virtual')
- final bool? virtual;
- final bool? isMine;
- UserInfo({
- required this.id,
- required this.phoneNumber,
- this.remark,
- this.timestamp,
- this.blockedHim,
- this.blockedMe,
- this.lastLocation,
- this.virtual,
- this.isMine,
- });
- factory UserInfo.fromJson(Map<String, dynamic> json) =>
- _$UserInfoFromJson(json);
- Map<String, dynamic> toJson() => _$UserInfoToJson(this);
- String getUserNickName() {
- return remark ?? phoneNumber;
- }
- }
|