In recurring functions such as CustomPaint()'s paint(), if I create an object this way:
void paint(Canvas canvas, Size size) {
    
  ....
  
  var myObj = MyClass();
  var myObj.configure(canvas, size);
 
  ....
    
}
Will this object get recreated while paint() gets called every frame
or will it be cached until something it depends on such as screen size changes?
 
    