i wanna get a Data from GetStorage(),
i got a Shop List and i can use it as Static for only page, that way im saving my List in GetStorage,if i go to another Page that will showed also. Like a SharedPreferences. How can i show a data from GetStorage List Value , like
Text(basket[name]), that will show only the Names, Text(basket[price]), that will show only Prices,
var basketsd = GetStorage("totalList");
My ProductModel for Shop,
class PriceModel2 {
final String name;
final double price;
PriceModel2({
this.name,
this.price,
});
}
its also not worked.
Text(controller.basketsd.read(["name"])
Container(
height: Get.size.height * 0.3,
child: Obx(() => ListView.builder(
itemCount: controller.basket.length,
itemBuilder: (BuildContext context, int index) {
return Column(
children: [
SizedBox(
height: 20,
),
Container(
width: Get.size.width,
child: ElevatedButton(
onPressed: () {
controller.basket
.remove(controller.basket[index]);
},
child: (Text(controller.basketsd.read(["name"]) +
" " +
controller.basket[index].price.toString() +
" €"))),
),
SizedBox(
height: 20,
),
],
);
})),
),
Codes show like this , (https://prnt.sc/1fs6mbf)