boolToConnectionStatus function Null safety

UserConnectionStatus boolToConnectionStatus(
  1. bool? isOnline
)

Implementation

UserConnectionStatus boolToConnectionStatus(bool? isOnline) => isOnline == null
    ? UserConnectionStatus.notAvailable
    : isOnline
        ? UserConnectionStatus.online
        : UserConnectionStatus.offline;