Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
[使用json注解和可序列化][1]
[不理解错误][2]
您不能使用与对象相同的名称来命名对象的实例。这可以解决问题:
addproductmodel _addproductmodel = addproductmodel(product_name: _productname.text);
为了清楚起见,您的班级名称也应以大写字母开头。我建议您阅读此内容。