matches method

bool matches(
  1. Device? device
)

Whether this command can run against device given its platform and running-state constraints.

Implementation

bool matches(Device? device) {
  if (platforms.isNotEmpty) {
    if (device == null || !platforms.contains(device.os)) return false;
  }
  if (requiresRunning && (device == null || !device.isRunning)) {
    return false;
  }
  return true;
}