评价星星组件:star_rating.dart(资料)
import 'package:flutter/material.dart';
/**
* 使用方法:
* StarRating(
rating: 1.5,
maxRating: 5.0
size: 30,
count: 5,
),
*/
/// 评分星星
class StarRating extends StatefulWidget {
final double rating; // 评分值
final double maxRating; // 最大评分值
final Widget unselectedImage; // 没有选中图片
final Widget selectedImage; // 选中图片
final int count; // 星星个数
final double size; // 星星大小
final Color unselectedColor; // 没有选中的颜色
final Color selectedColor; // 选中颜色
StarRating({
@required this.rating,
this.maxRating = 10,
this.size = 20,
this.unselectedColor = const Color(0xffbbbbbb),
this.selectedColor = const Color(0xffe0aa46),
Widget unselectedImage,
Widget selectedImage,
this.count = 5,
}) : unselectedImage = unselectedImage ??
Ic