getZoneById method

  1. @override
Zone getZoneById(
  1. int id
)
override

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

@override
Zone getZoneById(int id) {
    final _getZoneByIdFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
        Pointer<Void> Function(Pointer<Void>, Int32),
        Pointer<Void> Function(Pointer<Void>, int)
      >('navigine_sdk_flutter_Sublocation_getZoneById__Id'));
    final _idHandle = navigine_sdk_flutter_int_ToFfi(id);
    final _handle = this.handle;
    final __resultHandle = _getZoneByIdFfi(_handle, _idHandle);
    navigine_sdk_flutter_int_ReleaseFfiHandle(_idHandle);
    final _result = navigine_sdk_flutter_Zone_FromFfi(__resultHandle);
    navigine_sdk_flutter_Zone_ReleaseFfiHandle(__resultHandle);
    return _result;
}