executeAction method
- {required BuildContext context,
- required WidgetRef ref,
- required AppModel appModel,
- required CreatorModel creatorModel,
- required DictionaryHeading heading,
- 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);
}
}