joinedMembers property Null safety

List<Member> joinedMembers

Implementation

List<Member> get joinedMembers {
  if (data['users'] != null) {
    final dics = data['users'] as List<Map<String, dynamic>>;
    final users = dics.map((e) => Member.fromJson(e)).toList();
    users.forEach((e) => e.state = MemberState.joined);
    return users;
  } else {
    final user = Member.fromJson(data);
    user.state = MemberState.joined;
    return [user];
  }
}