user.dart 635 B

1234567891011121314151617181920212223
  1. import 'package:freezed_annotation/freezed_annotation.dart';
  2. import 'package:flutter/foundation.dart';
  3. part 'user.freezed.dart';
  4. part 'user.g.dart';
  5. @freezed
  6. class User with _$User {
  7. const factory User({
  8. String? country,
  9. String? userIp,
  10. String? accessToken,
  11. String? refreshToken,
  12. String? accountKey,
  13. String? accountPassword,
  14. String? createTime,
  15. bool? geographyEea,
  16. int? memberLevel, // 会员等级 1 游客 2 普通用户 3 会员
  17. String? account, // 用户名
  18. bool? activated, // 是否激活
  19. }) = _User;
  20. factory User.fromJson(Map<String, Object?> json) => _$UserFromJson(json);
  21. }