removeMember method

Member? removeMember(
  1. String? userId
)

Implementation

Member? removeMember(String? userId) {
  if (userId == null) return null;

  final index = members.indexWhere((element) => element.userId == userId);
  if (index != -1) {
    final member = members.removeAt(index);
    _refreshMemberCounts();
    return member;
  }
  return null;
}