Class ‘Home’ has no instance method ‘call’.
Receiver: Instance of ‘Home’
Tried calling: call(addToCart: Closure: (ProductDataModel) => void from Function ‘addToCart’:., cartItems: Instance(length:0) of ‘_GrowableList’)
I attempted to use the Home widget in my Flutter app to handle a callback function named addToCart, which is intended to add a product to the cart.
I expected that when invoking the addToCart method within the Home widget, it would correctly trigger the addToCart function passed down to child widgets, such as ProductTileWidget, allowing me to interact with the cart functionality.
Raihan bk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.