搜尋套件、儲存庫與 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.

所屬分類

原始碼儲存庫

使用此套件的專案