import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:initial_folder/helper/validator.dart';

import '../../../size_config.dart';
import '../../../theme.dart';

class DetailListUlasan extends StatelessWidget {
  const DetailListUlasan({
    Key? key,
    required this.name,
    required this.starRating,
    required this.review,
    required this.date,
  }) : super(key: key);
  final String name;
  final double starRating;
  final String review;
  final String date;
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          SizedBox(height: getProportionateScreenHeight(5)),
          Text(
            name,
            style: thirdTextStyle.copyWith(
              fontWeight: semiBold,
              fontSize: getProportionateScreenWidth(14),
            ),
          ),
          SizedBox(height: getProportionateScreenHeight(5)),
          Row(
            children: [
              RatingBarIndicator(
                itemSize: getProportionateScreenWidth(11),
                rating: starRating,
                direction: Axis.horizontal,
                itemCount: 5,
                itemPadding: EdgeInsets.symmetric(
                    horizontal: getProportionateScreenWidth(1)),
                //itemPadding: EdgeInsets.symmetric(horizontal: 4.0),
                itemBuilder: (context, _) =>
                    FaIcon(FontAwesomeIcons.solidStar, color: thirteenColor),
              ),
              SizedBox(width: getProportionateScreenWidth(5)),
              Text(
                dateFormatUlasan(date),
                style: thirdTextStyle.copyWith(
                  fontSize: getProportionateScreenWidth(10),
                ),
              )
            ],
          ),
          Container(
            child: Text(
              review,
              style: thirdTextStyle.copyWith(
                fontSize: getProportionateScreenWidth(12),
              ),
            ),
          ),
          SizedBox(height: getProportionateScreenHeight(7)),
          Divider(
            color: Color(0xff2D2D2D),
            thickness: 1,
          ),
        ],
      ),
    );
  }
}
