dumpTree method

  1. @override
void dumpTree({
  1. dynamic callback(
    1. String tree
    )?,
  2. String header = 'Dumping route tree:',
  3. String tab = ' ',
  4. bool showMatchers = false,
})
override

Creates a visual representation of the route hierarchy and passes it to a callback. If none is provided, print is called.

Implementation

@override
void dumpTree(
    {Function(String tree)? callback,
    String header = 'Dumping route tree:',
    String tab = '  ',
    bool showMatchers = false}) {
  if (environment.isProduction) {
    _flattened ??= flatten(this);

    _flattened!.dumpTree(
        callback: callback,
        header: header.isNotEmpty == true
            ? header
            : (environment.isProduction
                ? 'Dumping flattened route tree:'
                : 'Dumping route tree:'),
        tab: tab);
  } else {
    super.dumpTree(
        callback: callback,
        header: header.isNotEmpty == true
            ? header
            : (environment.isProduction
                ? 'Dumping flattened route tree:'
                : 'Dumping route tree:'),
        tab: tab);
  }
}