[英]flutter run pub run build_runner build failed
[used json annotation and serializable ][1] [使用 json 注释和可序列化][1]
[Not understanding the error][2] [不理解错误][2]
You can't name the instance of the object with the same name as the object.您不能将 object 的实例命名为与 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.我建议您阅读此内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.