import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

// ignore: must_be_immutable
class StarWidget extends StatelessWidget {
   int? itemSize;

   StarWidget({this.itemSize});

  @override
  Widget build(BuildContext context) {
    return IgnorePointer(
      child: RatingBar.builder(
        itemSize: itemSize?.h ?? 20.h,
        initialRating: 5,
        minRating: 1,
        direction: Axis.horizontal,
        allowHalfRating: true,
        itemCount: 5,
        itemPadding: EdgeInsets.symmetric(horizontal: 0),
        itemBuilder: (context, _) => Icon(
          Icons.star,
          color: Colors.amber,
        ),
        onRatingUpdate: (rating) {
          // print(rating);
        },
      ),
    );
  }
}
