| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- import 'dart:convert';
- import 'package:azlistview/azlistview.dart';
- import 'package:prime_chat/basic/Method.dart';
- import 'Global.dart';
- /// 图片
- class RemoteImageInfo {
- // String originalName;
- final String path;
- final String fileServer;
- RemoteImageInfo({required this.path, this.fileServer = "$server/file/"});
- const RemoteImageInfo.mock()
- : path = "",
- fileServer = "";
- RemoteImageInfo.fromJson(Map<String, dynamic> json)
- :
- // this.originalName = json["originalName"],
- path = json["path"],
- fileServer = json["fileServer"];
- }
- class FriendInfo extends ISuspensionBean {
- String? tagIndex;
- final Profile profile;
- FriendInfo({required this.profile, this.tagIndex});
- @override
- String getSuspensionTag() => tagIndex ?? name.substring(0, 1);
- String get name => profile.name;
- // toJson() => {"username": username, "uid": uid};
- // @override
- // String toString() => jsonEncode(this);
- }
- /// 用户自己的信息
- class Profile {
- final String id;
- final String name;
- final RemoteImageInfo avatar;
- const Profile(
- {this.id = "",
- required this.name,
- this.avatar = const RemoteImageInfo.mock()});
- Profile.fromJson(Map<String, dynamic> json)
- : name = json["name"],
- id = json["userId"].toString(),
- avatar = RemoteImageInfo(path: json["avatar"]);
- }
|