- override
Accumulates a list of strings describing the current node's fields, one
field per string. Subclasses should override this to have their
information included in toStringDeep
.
Source
@override void debugFillDescription(List<String> description) { super.debugFillDescription(description); bool inReleaseMode = true; assert(() { inReleaseMode = false; if (debugSymmetricPaintCount + debugAsymmetricPaintCount == 0) { description.add('usefulness ratio: no metrics collected yet (never painted)'); } else { double percentage = 100.0 * debugAsymmetricPaintCount / (debugSymmetricPaintCount + debugAsymmetricPaintCount); String diagnosis; if (debugSymmetricPaintCount + debugAsymmetricPaintCount < 5) { diagnosis = 'insufficient data to draw conclusion (less than five repaints)'; } else if (percentage > 90.0) { diagnosis = 'this is an outstandingly useful repaint boundary and should definitely be kept'; } else if (percentage > 50.0) { diagnosis = 'this is a useful repaint boundary and should be kept'; } else if (percentage > 30.0) { diagnosis = 'this repaint boundary is probably useful, but maybe it would be more useful in tandem with adding more repaint boundaries elsewhere'; } else if (percentage > 10.0) { diagnosis = 'this repaint boundary does sometimes show value, though currently not that often'; } else if (debugAsymmetricPaintCount == 0) { diagnosis = 'this repaint boundary is astoundingly ineffectual and should be removed'; } else { diagnosis = 'this repaint boundary is not very effective and should probably be removed'; } description.add('metrics: ${percentage.toStringAsFixed(1)}% useful ($debugSymmetricPaintCount bad vs $debugAsymmetricPaintCount good)'); description.add('diagnosis: $diagnosis'); } return true; }); if (inReleaseMode) description.add('(run in checked mode to collect repaint boundary statistics)'); }