copyWith method

RouteContext<T> copyWith({
  1. BuildContext? context,
  2. T? data,
  3. Map<String, String>? queryParameters,
  4. String? routeName,
  5. String? originalRouteName,
})

Create a copy with some fields changed.

Implementation

RouteContext<T> copyWith({
  BuildContext? context,
  T? data,
  Map<String, String>? queryParameters,
  String? routeName,
  String? originalRouteName,
}) {
  return RouteContext<T>(
    context: context ?? this.context,
    data: data ?? this.data,
    queryParameters: queryParameters ?? this.queryParameters,
    routeName: routeName ?? this.routeName,
    originalRouteName: originalRouteName ?? this.originalRouteName,
  );
}