getZoneById abstract method

Zone getZoneById(
  1. int id
)

Method returns the zone (within the current sublocation) with the specified identifier or null if no such zone exists. id zone unique identifier. Returns found zone object or null Zone.

Example:

// Get zone by ID
if (zones.isNotEmpty) {
 Zone? zoneById = sublocation.getZoneById(zones.first.getId());
 if (zoneById != null) {
   print('Found zone by ID: ${zoneById.getId()}');
   demonstrateZoneUsage(zoneById);
 }
}

Implementation

Zone getZoneById(int id);