首页 > 解决方案 > 使用列表选项,在单个 ID 图像中用作滑块

问题描述

class QuotationResources {
 
  final String price,vehicleShowcase,vehicleShowcaseLeft,vehicleShowcaseRight,vehicleShowcaseRear; 
 QuotationResources({
    this.vehicleNumber,
    this.vehicleShowcase,
    this.vehicleShowcaseLeft,
    this.vehicleShowcaseRight,
    this.vehicleShowcaseRear,
    this.price,
  });
}
 
List<QuotationResources> quotationResources = [
  QuotationResources(
    id: 1,
    vehicleShowcase: "assets/images/truck_1.jpeg",
    vehicleShowcaseLeft: "assets/images/truck_2.jpg",
    vehicleShowcaseRight: "assets/images/truck_3.jpg",
    vehicleShowcaseRear: "assets/images/truck_4.jpeg" ),
];

基本上我只想滑块,如何使用 id=1 图像作为滑块(如 vehicleShowcase、vehicleShowcaseLeft、vehicleShowcaseRight、vehicleShowcaseRear),下面的图像我需要以这种格式添加

图片:AssetImage(quotationResources.vehicleShowcase),

标签: flutter

解决方案


推荐阅读