September 2019
Beginner
512 pages
12h 52m
English
The CustomPaint widget simply works as the bridge between the widget tree (by being a widget) and a lower-level painting layer with access to Canvas. To create this, we must have a CustomPainter instance as it does not make sense to have CustomPaint without a painter.
To create a CustomPaint widget, we first add it to our widget tree just like we do for other widgets. Let's take a look at its constructor first to understand it:
const CustomPaint({ Key key, CustomPainter painter, CustomPainter foregroundPainter, Size size: Size.zero, bool isComplex: false, bool willChange: false, Widget child})
There are a few properties we need to take a look at to understand how it works:
Read now
Unlock full access