painter property Null safety

CustomPainter? painter
final

Implementation

final CustomPainter? painter;