factory ConnectionStatus.fromMap(Map<String, dynamic> map) { return ConnectionStatus( status: toEnum(map['status'], Status.values) ?? Status.unknown, ); }