パッケージ、リポジトリ、アプリカテゴリを検索

flutter_rating_bar のカバー
パッケージ詳細v4.0.1

flutter_rating_bar

Flutter用のシンプルだが完全にカスタマイズ可能なレーティングバーで、任意の分数のレーティングをサポートするレーティングバーインジケーターも含まれます。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
35.5万
いいね数
2530
Pub ポイント
150

パッケージをインストール

flutter pub add flutter_rating_bar

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Flutter向けに高度にカスタマイズ可能なレーティングバーウィジェットで、分数評価をサポートしており、ユーザーのフィードバックに最適です。インタラクティブなレーティングバーと静的なインジケーターの両方を提供し、すべてのプラットフォームで外観や動作を正確に制御できます。パッケージは軽量で、簡単に統合でき、レーティング選択時にスムーズな視覚フィードバックを提供します。レビュー、アプリ評価、または星付きスコアの直感的なユーザー入力が必要なあらゆるシナリオに最適です。

用途

  • ユーザー評価システム
  • 製品評価インターフェース
  • フィードバック収集フォーム
  • 星ベースの評価ツール
  • インタラクティブなUI要素

主な機能

  • 小数点付きの評価をサポート
  • 完全にカスタマイズ可能な外観
  • インタラクティブモードと非インタラクティブモード
  • クロスプラットフォーム互換性
  • Flutter とのシンプルな統合
  • 内蔵のレーティングインジケーター

適している対象

  • フィードバックウィジェットが必要なアプリ開発者
  • 柔軟なUIコンポーネントを望むデザイナー
  • スターに基づく入力が必要なプロジェクト
  • モバイルおよびウェブアプリケーション
  • 教育的またはレビュー中心のアプリ

注意事項

  • レーティング変更コールバックの手動処理が必要です
  • 限定的な組み込み検証
  • カスタムスタイルには追加のコードが必要になる場合があります
  • 非常に大きなデータセットには最適化されていません
  • デフォルトでは組み込みアニメーションなし

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

FLUTTER RATING BAR

Pub License Web Demo GitHub code size in bytes GitHub stars

A simple yet fully customizable rating bar for flutter which also include a rating bar indicator, supporting any fraction of rating.

DEMO

Salient Features

  • Set minimum and maximum rating
  • Any widgets can be used as as rating bar/indicator items
  • Different widgets can be used in same rating bar as per position
  • Supports vertical layout
  • Glows on interaction
  • Supports RTL mode
Web Demo

Usage

Using Flutter Rating Bar

Rating Bar can be used in three ways.

First Way:

Using RatingBar.builder()

First Way

RatingBar.builder(
   initialRating: 3,
   minRating: 1,
   direction: Axis.horizontal,
   allowHalfRating: true,
   itemCount: 5,
   itemPadding: EdgeInsets.symmetric(horizontal: 4.0),
   itemBuilder: (context, _) => Icon(
     Icons.star,
     color: Colors.amber,
   ),
   onRatingUpdate: (rating) {
     print(rating);
   },
);
Second Way:

Using RatingBar()

Second Way

RatingBar(
   initialRating: 3,
   direction: Axis.horizontal,
   allowHalfRating: true,
   itemCount: 5,
   ratingWidget: RatingWidget(
     full: _image('assets/heart.png'),
     half: _image('assets/heart_half.png'),
     empty: _image('assets/heart_border.png'),
   ),
   itemPadding: EdgeInsets.symmetric(horizontal: 4.0),
   onRatingUpdate: (rating) {
     print(rating);
   },
);

Heart Icons are Available Here.

Third Way:

Using RatingBar.builder() with index

Third Way

RatingBar.builder(
    initialRating: 3,
    itemCount: 5,
    itemBuilder: (context, index) {
       switch (index) {
          case 0:
             return Icon(
                Icons.sentiment_very_dissatisfied,
                color: Colors.red,
             );
          case 1:
             return Icon(
                Icons.sentiment_dissatisfied,
                color: Colors.redAccent,
             );
          case 2:
             return Icon(
                Icons.sentiment_neutral,
                color: Colors.amber,
             );
          case 3:
             return Icon(
                Icons.sentiment_satisfied,
                color: Colors.lightGreen,
             );
          case 4:
              return Icon(
                Icons.sentiment_very_satisfied,
                color: Colors.green,
              );
       }
    },
    onRatingUpdate: (rating) {
      print(rating);
    },
;
Using Flutter Rating Bar Indicator

Indicator

RatingBarIndicator(
    rating: 2.75,
    itemBuilder: (context, index) => Icon(
         Icons.star,
         color: Colors.amber,
    ),
    itemCount: 5,
    itemSize: 50.0,
    direction: Axis.vertical,
),
Vertical Mode

Vertical

In order to make the indicator scrollable, just use 'physics' property as in the example.

Info

To know more about the available properties, head on to api docs.

Feel Free to request any missing features or report issues here.

License

Copyright (c) 2021 Sarbagya Dhaubanjar

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト