forPlatform method

Metadata forPlatform (
  1. SuitePlatform platform
)

Returns a copy of this with all platform-specific metadata from onPlatform resolved.

Implementation

Metadata forPlatform(SuitePlatform platform) {
  if (onPlatform.isEmpty) return this;

  var metadata = this;
  onPlatform.forEach((platformSelector, platformMetadata) {
    if (!platformSelector.evaluate(platform)) return;
    metadata = metadata.merge(platformMetadata);
  });
  return metadata.change(onPlatform: {});
}