content: import 'package:cached_network_image/cached_network_image.dart';
  import 'package:flutter/material.dart';
  import 'package:flutter_modularization/common/color_helper.dart';
  
  class CardListMovies extends StatelessWidget {
    final String image;
    final String vote;
    final String title;
    final String releaseDate;
    final List<Widget> genre;
    final String overview;
  
    const CardListMovies({
      Key? key,
      required this.image,
      required this.vote,
      required this.title,
      required this.releaseDate,
      required this.genre,
      required this.overview,
    }) : super(key: key);
  
    @override
    Widget build(BuildContext context) {
      return Container(
        margin: EdgeInsets.all(5),
        child: Card(
          child: Row(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              // image
              Container(
                width: 130,
                height: 200,
                child: CachedNetworkImage(
                  imageUrl: image,
                  errorWidget: (context, url, error) => Icon(Icons.error),
                ),
              ),
              Expanded(
                child: Container(
                  width: 260,
                  padding: EdgeInsets.all(10),
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: <Widget>[
                      Container(
                        child: Row(
                          mainAxisSize: MainAxisSize.max,
                          crossAxisAlignment: CrossAxisAlignment.start,
                          mainAxisAlignment: MainAxisAlignment.start,
                          children: <Widget>[
                            // circle vote average
                            Container(
                              width: 40,
                              height: 40,
                              child: Stack(
                                children: <Widget>[
                                  Center(
                                    child: Container(
                                      width: 40,
                                      height: 40,
                                      decoration: BoxDecoration(
                                          color: Colors.blueGrey,
                                          borderRadius:
                                              BorderRadius.circular(20)),
                                    ),
                                  ),
                                  Center(
                                    child: Container(
                                        width: 30,
                                        height: 30,
                                        child: CircularProgressIndicator(
                                          strokeWidth: 3.0,
                                          valueColor:
                                              AlwaysStoppedAnimation<Color>(
                                                  VoteColorHelper.getColor(
                                                      double.parse(vote))),
                                          backgroundColor: Colors.grey,
                                          value: double.parse(vote) / 10.0,
                                        )),
                                  ),
                                  Center(
                                    child: Container(
                                        width: 30,
                                        height: 30,
                                        child: Center(
                                          child: Text(
                                            (double.parse(vote) * 10.0)
                                                    .floor()
                                                    .toString() +
                                                '%',
                                            style: TextStyle(
                                                fontWeight: FontWeight.w700,
                                                fontSize: 11,
                                                color: Colors.white),
                                          ),
                                        )),
                                  )
                                ],
                              ),
                            ),
                            SizedBox(
                              width: 10,
                            ),
                            Flexible(
                              child: Column(
                                mainAxisSize: MainAxisSize.max,
                                crossAxisAlignment: CrossAxisAlignment.start,
                                children: <Widget>[
                                  Text(
                                    title,
                                    overflow: TextOverflow.ellipsis,
                                    style: TextStyle(
                                        fontWeight: FontWeight.w600,
                                        fontSize: 20),
                                  ),
                                  Text(
                                    releaseDate,
                                    style: TextStyle(
                                        color: Colors.grey[800], fontSize: 14),
                                  )
                                ],
                              ),
                            )
                          ],
                        ),
                      ),
                      SizedBox(
                        height: 10,
                      ),
                      SingleChildScrollView(
                        scrollDirection: Axis.horizontal,
                        child: Row(
                          children: genre,
                        ),
                      ),
                      SizedBox(
                        height: 10,
                      ),
                      Container(
                        width: 360,
                        child: Text(
                          overview,
                          softWrap: true,
                          maxLines: 6,
                          overflow: TextOverflow.ellipsis,
                        ),
                      ),
                    ],
                  ),
                ),
              ),
            ],
          ),
        ),
      );
    }
  }
  