搜尋套件、儲存庫與 APP 分類

animated_rating_stars 封面
套件詳情v1.0.1

animated_rating_stars

一個高度可自訂的Flutter評分條小部件,用於互動式星形評分。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1970
喜歡數
54
Pub 分數
140

安裝套件

flutter pub add animated_rating_stars

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個可自訂的 Flutter 小工具,用於互動式的星型評分,具備順暢動畫。它允許使用者透過動畫星星直觀地選擇評分,支援單一與連續評分模式。此小工具高度可設定,可自訂星星大小、顏色、間距與動畫效果。適用於跨多個平台的回饋表單、評論與使用者評估。

適用情境

  • 用戶評論系統
  • 產品評分介面
  • 反饋收集表單
  • 互動調查
  • 應用審核部分

主要特色

  • 平滑的動畫星星過渡
  • 可自定的星星外觀
  • 支援連續與離散評分
  • 跨平台相容性
  • 與 Flutter 的輕鬆整合
  • 可設定的點擊行為

適合對象

  • 應用中的評分控件
  • 互動式回饋元件
  • 行動和網路應用
  • 尋求視覺吸引力的設計人員
  • 需要輕量級解決方案的開發人員

使用建議

  • 有限的內建驗證
  • 預設情況下沒有樣式
  • 需要手動處理評分狀態
  • 動畫效能可能在低階裝置上有所差異
  • 不適用於非星級評分類型

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Animated Rating Stars for Flutter

Package Version Package Downloads GitHub Stars GitHub Forks License

AnimatedRatingStars is a highly customizable animated rating bar widget for Flutter. It allows users to interactively provide ratings by tapping on stars. The package offers a wide range of customization options and is designed to be easy to integrate into your Flutter applications.

Demo

DEMO1 DEMO2 DEMO3

Features

  • Create animated rating bars with filled, half-filled, and empty stars.
  • Customize star colors, icons, sizes, and animation parameters.
  • Display the rating value and enable interactive tooltips for half-filled stars.
  • Supports both read-only and interactive modes.

Installation

To use this package, add animated_rating_stars as a dependency in your pubspec.yaml file:

dependencies:
  animated_rating_stars: ^1.0.1

Then, run flutter pub get to fetch the package.

Usage

Import the package in your Dart code:

import 'package:animated_rating_stars/animated_rating_stars.dart';

Now, you can use the AnimatedRatingStars widget in your Flutter app:

AnimatedRatingStars(
  initialRating: 3.5,
  minRating: 0.0,
  maxRating: 5.0,
  filledColor: Colors.amber,
  emptyColor: Colors.grey,
  filledIcon: Icons.star,
  halfFilledIcon: Icons.star_half,
  emptyIcon: Icons.star_border,
  onChanged: (double rating) {
    // Handle the rating change here
    print('Rating: $rating');
  },
  displayRatingValue: true,
  interactiveTooltips: true,
  customFilledIcon: Icons.star,
  customHalfFilledIcon: Icons.star_half,
  customEmptyIcon: Icons.star_border,
  starSize: 30.0,
  animationDuration: Duration(milliseconds: 300),
  animationCurve: Curves.easeInOut,
  readOnly: false,
)

Customize the properties according to your requirements. The onChanged callback is called when the rating changes.

For more examples and usage details, refer to the examples directory included with this package.

Customization

You can customize the appearance and behavior of the rating bar using the following properties:

  • initialRating: The initial rating value.
  • minRating: The minimum rating value.
  • maxRating: The maximum rating value.
  • filledColor: The color for filled stars.
  • emptyColor: The color for empty stars.
  • filledIcon: The icon used for filled stars.
  • halfFilledIcon: The icon used for half-filled stars.
  • emptyIcon: The icon used for empty stars.
  • displayRatingValue: Show or hide the rating value.
  • interactiveTooltips: Enable interactive tooltips for half-filled stars.
  • customFilledIcon: Use a custom icon for filled stars.
  • customHalfFilledIcon: Use a custom icon for half-filled stars.
  • customEmptyIcon: Use a custom icon for empty stars.
  • starSize: Set the size of each star.
  • animationDuration: Adjust the duration of the animation when the rating changes.
  • animationCurve: Define the animation curve for the rating change.
  • readOnly: Make the widget read-only.

Customization

Contributions and feedback are welcome! If you encounter any issues or have feature requests, please open an issue on GitHub.

License

This package is distributed under the MIT License. See LICENSE for details.

For more Flutter packages and development resources, visit pub.dev.

所屬分類

依賴

依賴清單 1 項

  • plugin_platform_interface^2.0.2

原始碼儲存庫

使用此套件的專案