|
@@ -17,21 +17,18 @@ class HomeView extends GetView<HomeController> {
|
|
itemCount: controller.state.goodsData.length,
|
|
itemCount: controller.state.goodsData.length,
|
|
itemBuilder: (context, index) {
|
|
itemBuilder: (context, index) {
|
|
return ListTile(
|
|
return ListTile(
|
|
- title: Text(controller.state.goodsData[index].title ??
|
|
|
|
- ''),
|
|
|
|
- trailing: InkWell(
|
|
|
|
- onTap: () {
|
|
|
|
- controller.toDetail(index);
|
|
|
|
- },
|
|
|
|
- child: Obx(() {
|
|
|
|
- return Text(controller.state.likeList.contains(
|
|
|
|
- controller.state.goodsData[index]) ? '已收藏' : '收藏商品');
|
|
|
|
- })
|
|
|
|
- ),
|
|
|
|
|
|
+ title: Text(controller.state.goodsData[index].title ?? ''),
|
|
|
|
+ trailing: InkWell(onTap: () {
|
|
|
|
+ controller.toDetail(index);
|
|
|
|
+ }, child: Obx(() {
|
|
|
|
+ return Text(controller.state.likeList
|
|
|
|
+ .contains(controller.state.goodsData[index])
|
|
|
|
+ ? '已收藏'
|
|
|
|
+ : '收藏商品');
|
|
|
|
+ })),
|
|
);
|
|
);
|
|
});
|
|
});
|
|
}),
|
|
}),
|
|
-
|
|
|
|
);
|
|
);
|
|
}
|
|
}
|
|
}
|
|
}
|