onSearch method

  1. @override
void onSearch(
  1. String searchTerm,
  2. {String? sentence = ''}
)
override

Action upon selecting the Search option.

Implementation

@override
void onSearch(String searchTerm, {String? sentence = ''}) async {
  if (appModel.isMediaOpen) {
    await SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
    await Future.delayed(const Duration(milliseconds: 5), () {});
  }
  await appModel.openRecursiveDictionarySearch(
    searchTerm: searchTerm,
    killOnPop: false,
  );
  if (appModel.isMediaOpen) {
    await Future.delayed(const Duration(milliseconds: 5), () {});
    await SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
  }
}