executeAction method

  1. @override
Future<void> executeAction(
  1. {required BuildContext context,
  2. required WidgetRef ref,
  3. required AppModel appModel,
  4. required CreatorModel creatorModel,
  5. required DictionaryHeading heading,
  6. required String? dictionaryName}
)
override

Execute the functionality of this action.

Implementation

@override
Future<void> executeAction({
  required BuildContext context,
  required WidgetRef ref,
  required AppModel appModel,
  required CreatorModel creatorModel,
  required DictionaryHeading heading,
  required String? dictionaryName,
}) async {
  if (!appModel.isTermInStash(heading.term)) {
    appModel.addToStash(terms: [heading.term]);
  } else {
    appModel.removeFromStash(term: heading.term);
  }
}