User.fromMeJson constructor

User.fromMeJson(
  1. Map<String, dynamic> json
)

Creates a user instance from a current user (me) JSON response.

Implementation

factory User.fromMeJson(Map<String, dynamic> json) {
  return User(
    id: json['id'] as int? ?? 0, // Default to 0 for tests
    username: json['username'] as String?,
    image: json['image'] as String?,
    tier: json['tier'] as String?,
    status: json['status'] as String?,
  );
}