processActionRecipe method

  1. @override
bool processActionRecipe(
  1. ActionRecipe recipe,
  2. String regexTestString
)
override

Attempts to process a command for a recipe. Returns true if the regexTestString matches that of the processor currently running. The modifications are applied to the ActionRecipe provided.

Implementation

@override
bool processActionRecipe(ActionRecipe recipe, String regexTestString) {
  final selectOps = _selectGroup2.firstMatch(recipe.receivedText.trim());
  if (selectOps != null && selectOps.groupCount > 2) {
    final cmdAction =
        CommandUtils.setActionCommandVariant(selectOps.group(1) ?? "");
    final searchText = selectOps.group(3) ?? "";
    if (searchText.isNotEmpty) {
      recipe.name = AugnitoCommands.select;
      recipe.searchText = searchText.trim();
      recipe.isCommand = true;
      recipe.selectFor = cmdAction == AugnitoCommands.select ? "" : cmdAction;
      return true;
    }
  }
  return false;
}