flutter run pub run build_runner build failed

137 Views Asked by At

[used json annotation and serializable ][1]

[Not understanding the error][2]

1

There are 1 best solutions below

0
On

You can't name the instance of the object with the same name as the object. This will do the trick:

addproductmodel _addproductmodel = addproductmodel(product_name: _productname.text);

You class's names also should start with uppercase letter for clarity. I recommand you to read this.