INNER CODE UNIT · Dart

popTestFunc

MMMzq/bot_toast · lib/src/bot_toast_init.dart:26

  VoidCallback registerPopListener(PopTestFunc popTestFunc) {
    _listener.add(popTestFunc);
    return () {
      _listener.remove(popTestFunc);
    };
  }

  @override
  Future<bool> didPopRoute() async {
    if (_listener.isNotEmpty) {
      final clone = _listener.reversed.toList(growable: false);
      for (PopTestFunc popTest in clone) {
        if (popTest()) return true;
      }
    }
    return super.didPopRoute();
  }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…