📜  颤动图像滑块 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:17.878000             🧑  作者: Mango

代码示例1
carousel_slider: ^4.0.0

import 'package:carousel_slider/carousel_slider.dart';

  List imgList = [
    'https://picsum.photos/500/300?random=1',
    'https://picsum.photos/500/300?random=2',
    'https://picsum.photos/500/300?random=3',
    'https://picsum.photos/500/300?random=4',
    'https://picsum.photos/500/300?random=5',
  ];
  
  
  
  CarouselSlider.builder(
              itemCount: imgList.length,
              itemBuilder: (context, index, realIndex) {
                print(index);
                return Container(
                  // height: 200,
                  child: Image.network(imgList[index]),
                );
              },
              options: CarouselOptions(
                enlargeCenterPage: true,
                autoPlay: true,
              ),
            ),