一个适用于 Flutter 的平滑评分条小部件,提供视觉上吸引人且交互性强的基于星星的评分系统。该组件采用空安全设计,确保在 Android、iOS、Web、macOS、Windows 和 Linux 等所有平台上都能稳定运行。该包支持自定义星星外观,评分变化时具有流畅的动画效果,并支持交互式和只读模式。非常适合用于用户反馈表单、产品评论和应用评分。简洁的 API 使集成简单高效。
适合场景
用户评论和反馈
产品评分系统
应用审核界面
交互式表单元素
调查中的评分收集
主要特点
评分更改时的平滑动画
可自定义的星星大小和颜色
空安全实现
支持交互式和非交互式模式
跨平台兼容性
适合对象
开发反馈表单的开发者
需要直观评分输入的应用程序
针对多个平台的项目
以用户界面为重点的应用程序
Flutter 初学者寻找简单的控件
使用建议
需要手动处理评分值更新
仅限星级评分
无内置验证
最适合单评分场景
可能需要额外的样式来处理复杂的用户界面
原始 README
以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。
This is the null safety version of smooth_star_rating
All the credits go to the original authors,
You can find the original package here
https://pub.dev/packages/smooth_star_rating
A Star rating with touch and swipe rate enabled
Supports replacing default star icons with desired IconData
Supports half rate and full rate (1.0 or 0.5)
Swipe for incrementing/decrementing rate amount
Change star body and boundary colors independently
allowHalfRating - Whether to use whole number forrating(1.0 or 0.5)
onRatingChanged(int rating) - Rating changed callback
starCount - The maximum amount of stars
rating - The current value of rating
size - The size of a single star
color - The body color of star
borderColor - The border color of star
spacing - Spacing between stars(defaultis0.0)
filledIconData - FullRatedIcon
halfFilledIconData - HalfRatedIcon
defaultIconData - DefaultRatedIcon