Answers for "why does custom paint class has a child in flutter"

0

why does custom paint class has a child in flutter

CustomPaint(
  painter: Sky(),
  child: Center(
    child: Text(
      'Once upon a time...',
      style: const TextStyle(
        fontSize: 40.0,
        fontWeight: FontWeight.w900,
        color: Color(0xFFFFFFFF),
      ),
    ),
  ),
)
Posted by: Guest on June-06-2020
0

why does custom paint class has a child in flutter

CustomPaint class
A widget that provides a canvas on which to draw during the paint phase.

When asked to paint, CustomPaint first asks its painter to paint on the current canvas, then it paints its child, and then, after painting its child, it asks its foregroundPainter to paint. The coordinate system of the canvas matches the coordinate system of the CustomPaint object. The painters are expected to paint within a rectangle starting at the origin and encompassing a region of the given size. (If the painters paint outside those bounds, there might be insufficient memory allocated to rasterize the painting commands and the resulting behavior is undefined.) To enforce painting within those bounds, consider wrapping this CustomPaint with a ClipRect widget.
Posted by: Guest on June-06-2020

Code answers related to "why does custom paint class has a child in flutter"

Browse Popular Code Answers by Language