openRecursiveDictionarySearch method

Future<void> openRecursiveDictionarySearch(
  1. {required String searchTerm,
  2. required bool killOnPop,
  3. dynamic onUpdateQuery(
    1. String
    )?}
)

A helper function for doing a recursive dictionary search.

Implementation

Future<void> openRecursiveDictionarySearch({
  required String searchTerm,
  required bool killOnPop,
  Function(String)? onUpdateQuery,
}) async {
  _currentMediaPauseController.add(null);

  if (searchTerm.trim().isEmpty) {
    return;
  }

  await Navigator.push(
    _navigatorKey.currentContext!,
    PageRouteBuilder(
      pageBuilder: (context, animation1, animation2) =>
          RecursiveDictionaryPage(
        searchTerm: searchTerm,
        killOnPop: killOnPop,
        onUpdateQuery: onUpdateQuery,
      ),
      transitionDuration: Duration.zero,
      reverseTransitionDuration: Duration.zero,
    ),
  );
  refreshDictionaryHistory();
}