From a43be998ece82d0dd28e97cfb0880f327b243ff3 Mon Sep 17 00:00:00 2001 From: xster Date: Fri, 15 Dec 2017 15:56:28 -0800 Subject: [PATCH] Split one CustomPainter doc paragraph to bullet points (#13590) * split doc paragraph * specify shouldRepaint argument nullability * review --- .../lib/src/rendering/custom_paint.dart | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/flutter/lib/src/rendering/custom_paint.dart b/packages/flutter/lib/src/rendering/custom_paint.dart index 16da0293a6..baf663a142 100644 --- a/packages/flutter/lib/src/rendering/custom_paint.dart +++ b/packages/flutter/lib/src/rendering/custom_paint.dart @@ -39,12 +39,16 @@ typedef List SemanticsBuilderCallback(Size size); /// is provided, to check if the new instance actually represents different /// information. /// -/// The most efficient way to trigger a repaint is to either extend this class -/// and supply a `repaint` argument to the constructor of the [CustomPainter], -/// where that object notifies its listeners when it is time to repaint, or to -/// extend [Listenable] (e.g. via [ChangeNotifier]) and implement -/// [CustomPainter], so that the object itself provides the notifications -/// directly. In either case, the [CustomPaint] widget or [RenderCustomPaint] +/// The most efficient way to trigger a repaint is to either: +/// +/// * Extend this class and supply a `repaint` argument to the constructor of +/// the [CustomPainter], where that object notifies its listeners when it is +/// time to repaint. +/// * Extend [Listenable] (e.g. via [ChangeNotifier]) and implement +/// [CustomPainter], so that the object itself provides the notifications +/// directly. +/// +/// In either case, the [CustomPaint] widget or [RenderCustomPaint] /// render object will listen to the [Listenable] and repaint whenever the /// animation ticks, avoiding both the build and layout phases of the pipeline. /// @@ -234,6 +238,8 @@ abstract class CustomPainter extends Listenable { /// repaints should be avoided as much as possible, a [RepaintBoundary] or /// [RenderRepaintBoundary] (or other render object with /// [RenderObject.isRepaintBoundary] set to true) might be helpful. + /// + /// The `oldDelegate` argument will never be null. bool shouldRepaint(covariant CustomPainter oldDelegate); /// Called whenever a hit test is being performed on an object that is using