Class has no instance of setter '_scheduler'

Issue

I have a class which has a ViewChild _scheduler. Im not really sure why it needs a setter though since i am only wanting to use it to get the markup related to it. I am having some issues reading the error code since it isnt quite relating back to my files entirely as it is tracing X.template.dart so i cant quite see which line the issues are on.

I was looking at the html file, but it is actually just pointing to the closing tag to the Div.
enter image description hereenter image description here

Solution

Don’t use a private name for the ViewChild. In the generated code it is trying to set the ViewChild _scheduler on an instance of the component, but since it’s private, the setter call is failing. It should work if you rename it to scheduler.

Answered By – Harry Terkelsen

Answer Checked By – Jay B. (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *