removeOption method

  1. @override
int removeOption(
  1. String templateId,
  2. String optionId
)
override

Implementation

@override
int removeOption(String templateId, String optionId) {
  int actionIndex = -1;
  if (optionsMap[templateId] != null) {
    int? optionIndex = optionsMap[templateId]
        ?.indexWhere((element) => (element.id == optionId));
    if (optionIndex != null && optionIndex != -1) {
      optionsMap[templateId]!.removeAt(optionIndex);
      actionIndex = optionIndex;
      update();
    }
  }
  return actionIndex;
}