패키지, 저장소 및 앱 카테고리 검색

flutter_rating_bar 표지
패키지 상세v4.0.1

flutter_rating_bar

Flutter용 간단하지만 완전히 사용자 정의 가능한 평점 바이며, 임의의 분수 평점을 지원하는 평점 바 인디케이터도 포함되어 있습니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
35.5만
좋아요
2.5천
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.

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트