filterHistory method Null safety

  1. @visibleForTesting
List<Destination> filterHistory(
  1. List<Destination> destinations

Filters the list of destinations to only contain the destination supported by the collection of page builders.


List<Destination> filterHistory(final List<Destination> destinations) {
  final List<Destination> filteredHistory = <Destination>[];

  for (final Destination destination in destinations) {
    final bool supportedDestination = any(
      (DBPageBuilder pageBuilder) => pageBuilder.supportRoute(destination),

    if (kDebugMode) {
        'Did not found a page builder that can build ${destination.path}',

    if (supportedDestination) {

  return filteredHistory;