getDisplayRuleByLocation function

Future<MPDisplayRule?> getDisplayRuleByLocation(
  1. FutureOr<MPLocation> location
)

Retrieve the display rule for the given location

Requires that loadMapsIndoors has successfully executed.

Implementation

Future<MPDisplayRule?> getDisplayRuleByLocation(
    FutureOr<MPLocation> location) async {
  final exists = await MapsindoorsPlatform.instance
      .locationDisplayRuleExists((await location).id);
  if (exists == true) {
    return MapsindoorsPlatform.instance
        .createDisplayRuleWithName((await location).id.value);
  } else {
    return null;
  }
}