rating_bar_flutter 1.0.2 copy "rating_bar_flutter: ^1.0.2" to clipboard
rating_bar_flutter: ^1.0.2 copied to clipboard

A new Flutter plugin for customisable Rating Bar with half rating support.

rating_bar_flutter #

A customizable Rating Bar Flutter for flutter with half rating support

pub package

Installation #

Add this to your package's pubspec.yaml file

dependencies:
  ...
  rating_bar_flutter: ^1.0.0

Usage #

First import the namespace

  import 'package:rating_bar/rating_bar_flutter.dart';

onRatingChanged callback returns current rating which is a double, when the rating has changed.

  RatingBarFlutter(
    onRatingChanged: (rating) => setState(() => _rating = rating!),
    filledIcon: Icons.star,
    emptyIcon: Icons.star_border,
    halfFilledIcon: Icons.star_half,
    isHalfAllowed: true,
    aligns: Alignment.centerLeft,
    filledColor: Colors.green,
    emptyColor: Colors.redAccent,
    halfFilledColor: Colors.amberAccent, 
    size: 48,
  ),

You can also use read-only rating bar widget

  RatingBarFlutter.readOnly(
    initialRating: 3.5,
    isHalfAllowed: true,
    aligns: Alignment.centerLeft,
    halfFilledIcon: Icons.star_half,
    filledIcon: Icons.star,
    emptyIcon: Icons.star_border,
  ),

License #

MIT License

Inspire me #

Be a Patreon

0
likes
140
points
70
downloads

Publisher

unverified uploader

Weekly Downloads

A new Flutter plugin for customisable Rating Bar with half rating support.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

flutter

More

Packages that depend on rating_bar_flutter