getSublocationById abstract method

Sublocation getSublocationById(
  1. int id
)

Method is used for obtaining a sublocation with the specified identifier from the current location. id sublocation identifier. Returns The Sublocation of the current location with the specified identifier, if it exists. If sublocation with the specified identifier doesn't exist, function returns null.

Example:

// Get sublocation by ID
if (sublocations.isNotEmpty) {
 Sublocation? sublocation = location.getSublocationById(sublocations.first.getId());
 if (sublocation != null) {
   demonstrateSublocationUsage(sublocation);
 }
}

Implementation

Sublocation getSublocationById(int id);