content: import 'package:flutter/material.dart';
  
  class RatingInformation extends StatelessWidget {
    final double rating;
  
    const RatingInformation({Key? key, required this.rating}) : super(key: key);
  
    Widget _buildRatingBar(ThemeData theme) {
      var stars = <Widget>[];
  
      for (var i = 1; i <= 5; i++) {
        var color = i <= rating ? theme.colorScheme.secondary : Colors.black12;
        var star = Icon(
          Icons.star,
          color: color,
        );
  
        stars.add(star);
      }
  
      return Row(children: stars);
    }
  
    @override
    Widget build(BuildContext context) {
      var theme = Theme.of(context);
      var textTheme = theme.textTheme;
      var ratingCaptionStyle = textTheme.caption!.copyWith(color: Colors.black45);
  
      var numericRating = Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Text(
            rating.toString(),
            style: textTheme.headline6!.copyWith(
              fontWeight: FontWeight.w400,
              color: theme.colorScheme.secondary,
            ),
          ),
          SizedBox(height: 4.0),
          Text(
            'Ratings',
            style: ratingCaptionStyle,
          ),
        ],
      );
  
      var starRating = Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          _buildRatingBar(theme),
          Padding(
            padding: const EdgeInsets.only(top: 4.0, left: 4.0),
            child: Text(
              'Grade now',
              style: ratingCaptionStyle,
            ),
          ),
        ],
      );
  
      return Row(
        crossAxisAlignment: CrossAxisAlignment.end,
        children: [
          numericRating,
          SizedBox(width: 16.0),
          starRating,
        ],
      );
    }
  }
  