I\'m developing a flutter app, where I need to scan some barcodes, so, for that, I use a plugin called barcode_scan (https://pub.dartlang.org/packages/barcode_scan). So, the pro
The above error occurs when you try to initialize a non-static variable directly when declaring it inside a class.
In your case I assume it's the mySteps
list which you are initializing directly.
Try initializing it inside your initState()
method if you are using a Stateful Widget
or inside a class constructor and the error will go away.
You can also check this answer for a detailed explanation regarding the same issue.