debugFillDescription method

  1. @mustCallSuper
void debugFillDescription (List<String> description)
@mustCallSuper

Add additional information to the given description for use by toString.

This method makes it easier for subclasses to coordinate to provide a high-quality toString implementation. The toString implementation on the ScrollController base class calls debugFillDescription to collect useful information from subclasses to incorporate into its return value.

If you override this, make sure to start your method with a call to super.debugFillDescription(description).

Implementation

@mustCallSuper
void debugFillDescription(List<String> description) {
  if (debugLabel != null)
    description.add(debugLabel);
  if (initialScrollOffset != 0.0)
    description.add('initialScrollOffset: ${initialScrollOffset.toStringAsFixed(1)}, ');
  if (_positions.isEmpty) {
    description.add('no clients');
  } else if (_positions.length == 1) {
    // Don't actually list the client itself, since its toString may refer to us.
    description.add('one client, offset ${offset?.toStringAsFixed(1)}');
  } else {
    description.add('${_positions.length} clients');
  }
}