i wanna create a Basket with Getx , i defined a values as Name and Price, i wanna add Basic a Product in to Shop Basket. How can i add a String as name or double as Price from Product into PriceModel2 -RxList ?
Product Model-
class PriceModel2 {
String name;
double price;
PriceModel2(String name, double price) {
this.name = name;
this.price = price;
}
}
Add Function
RxList<PriceModel2> basket = [].obs;
urunEkle(String isim) {
basket.add(isim);
basket.add(isim<basket>[name]);
}
UI
ElevatedButton(
onPressed: () {
controller.urunEkle(
material["name"] );
Thanks for all Help.