mirrored_repositories/flutter_proyects_in_2020/peliculas/lib/src
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:peliculas/src/models/pelicula_model.dart';

class CardSwiper extends StatelessWidget {
  final List<Pelicula> peliculas;

  CardSwiper({@required this.peliculas});

  @override
  Widget build(BuildContext context) {
    final _screenSize = MediaQuery.of(context).size;

    return  Container(
        padding: EdgeInsets.only(top:10.0),
        child: new Swiper(
          layout: SwiperLayout.STACK,
          itemWidth: _screenSize.width * 0.7,
          itemHeight: _screenSize.height * 0.5,
          itemBuilder: (BuildContext context,int index){
            return ClipRRect(
              borderRadius: BorderRadius.circular(20.0),
              // child: new Image.network("http://via.placeholder.com/350x150",
              child: FadeInImage( 
                image: NetworkImage(peliculas[index].getPosterImg()),
                placeholder: AssetImage('assets/img/no-image.jpg'),
                fit: BoxFit.cover,
              ),
              // child: Text('pelicul'),
              // fit: BoxFit.cover,)
              );
          },
          itemCount: peliculas.length, 
          // pagination: new SwiperPagination(),
          // control: new SwiperControl(),
        ),
      );
   
  }
}