copyWith method

StackRouterInheritedData copyWith({
  1. void pushRoute(
    1. String route
    )?,
  2. void popRoute([
    1. String route
    ])?,
  3. void switchRoute(
    1. String route
    )?,
  4. void showSnackBar({
    1. String? route,
    2. required StackRouterSnackBar snackBar,
    })?,
  5. void clearSnackBars({
    1. String? route,
    })?,
  6. void hideSnackBar({
    1. String? route,
    })?,
  7. String? currentRoute,
  8. String? route,
  9. List<String>? routeHistory,
  10. dynamic addMessenger({
    1. required StackRouterScaffoldMessenger messenger,
    2. required String route,
    })?,
  11. void onPop()?,
  12. Widget? child,
  13. bool? canPop,
})

Implementation

StackRouterInheritedData copyWith({
  void Function(String route)? pushRoute,
  void Function([String route])? popRoute,
  void Function(String route)? switchRoute,
  void Function({
    String? route,
    required StackRouterSnackBar snackBar,
  })?
      showSnackBar,
  void Function({String? route})? clearSnackBars,
  void Function({String? route})? hideSnackBar,
  String? currentRoute,
  String? route,
  List<String>? routeHistory,
  Function({
    required String route,
    required StackRouterScaffoldMessenger messenger,
  })?
      addMessenger,
  void Function()? onPop,
  Widget? child,
  bool? canPop,
}) {
  return StackRouterInheritedData(
    child: child ?? this.child,
    routeHistory: routeHistory ?? this.routeHistory,
    popRoute: popRoute ?? this.popRoute,
    pushRoute: pushRoute ?? this.pushRoute,
    switchRoute: switchRoute ?? this.switchRoute,
    showSnackBar: showSnackBar ?? this.showSnackBar,
    clearSnackBars: clearSnackBars ?? this.clearSnackBars,
    hideSnackBar: hideSnackBar ?? this.hideSnackBar,
    addMessenger: addMessenger ?? this.addMessenger,
    route: route ?? this.route,
    onPop: onPop ?? this.onPop,
    canPop: canPop ?? this.canPop,
  );
}