搜索插件、代码仓与 APP 分类

smooth_star_rating_null_safety 封面
插件详情v1.0.4+2

smooth_star_rating_null_safety

一个平滑的评分条

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
12
喜欢数
38
Pub 分数
130

安装插件

flutter pub add smooth_star_rating_null_safety

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个适用于 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
  • Control size of the star rating
  • Set your desired total Star count
  • Supports click-to-rate
  • Spacing between stars

Getting Started

In your flutter project add the dependency:

    dependencies:
        ...
        smooth_star_rating: 1.0.4+2

Usage example

import 'package:smooth_star_rating/smooth_star_rating.dart'; 
SmoothStarRating(
          allowHalfRating: false,
          onRatingChanged: (v) {
            rating = v;
            setState(() {});
          },
          starCount: 5,
          rating: rating,
          size: 40.0,
          filledIconData: Icons.blur_off,
          halfFilledIconData: Icons.blur_on,
          color: Colors.green,
          borderColor: Colors.green,
          spacing:0.0
        )

Constructor parameters

allowHalfRating                 -   Whether to use whole number for rating(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(default is 0.0)
filledIconData                  -   Full Rated Icon
halfFilledIconData              -   Half Rated Icon
defaultIconData                 -   Default Rated Icon
Screenshots
Full Rating

alt text

Half Rating

alt text

MIT LICENSE
Let me know if you find any bugs/issues.Thanks.

所属分类

源码仓库

使用此插件的项目