match method Null safety

Future<bool> match(
  1. EngineNotification notification,
  2. SpeechCondition condition
)

Matches a notification to type and run

Implementation

Future<bool> match(
    EngineNotification notification, SpeechCondition condition) async {
  // Stop if the type not in notification or condition
  if (notification.type != type || condition.type != type) return false;

  // Ensure not expired
  if (isExpired(notification)) return false;

  // TODO: Check if layer allowed

  // Check if condition for current run mode
  return checkRunMode(condition);
}