Route<T> constructor

Route<T>({
  1. RouteSettings? settings,
  2. bool? requestFocus,
})

Initialize the Route.

If the settings are not provided, an empty RouteSettings object is used instead.

If requestFocus is not provided, the value of Navigator.requestFocus is used instead.

Implementation

Route({
  RouteSettings? settings,
  bool? requestFocus,
}) : _settings = settings ?? const RouteSettings(),
     _requestFocus = requestFocus {
  if (kFlutterMemoryAllocationsEnabled) {
    FlutterMemoryAllocations.instance.dispatchObjectCreated(
      library: 'package:flutter/widgets.dart',
      className: '$Route<$T>',
      object: this,
    );
  }
}