ProfileManager_Mock.dart 872 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import 'package:ctjt_flutter/common/trtc/TxUtils.dart';
  2. class UserModel {
  3. String phone;
  4. String name;
  5. String avatar;
  6. String userId;
  7. UserModel(
  8. {this.phone = '', this.name = '', this.avatar = '', this.userId = ''});
  9. }
  10. class ProfileManager {
  11. static ProfileManager? _instance;
  12. static getInstance() {
  13. if (_instance == null) {
  14. _instance = new ProfileManager();
  15. }
  16. return _instance;
  17. }
  18. Future<List<UserModel>> queryUserInfo(String userId) {
  19. return Future.value([
  20. UserModel(
  21. phone: userId,
  22. name: userId,
  23. avatar: TxUtils.getDefaltAvatarUrl(),
  24. userId: userId)
  25. ]);
  26. }
  27. Future<UserModel> querySingleUserInfo(String userId) {
  28. return Future.value(UserModel(
  29. phone: userId,
  30. name: userId,
  31. avatar: TxUtils.getDefaltAvatarUrl(),
  32. userId: userId));
  33. }
  34. }