From 01c950fddf68bd92fa2888ddb355336ab3ecf84a Mon Sep 17 00:00:00 2001 From: thangrobul infimate Date: Thu, 26 Dec 2019 15:18:17 +0530 Subject: [PATCH] Revert "Merge branch 'p30arena-patch-1' into dev" This reverts commit e2ac09d8ca70940ec93453b1b7bcbb94674b6a78, reversing changes made to 394aabd501d44d78bbbda57fc07c14086fb3a74a. --- lib/smooth_star_rating.dart | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/smooth_star_rating.dart b/lib/smooth_star_rating.dart index c36de73..abb546e 100644 --- a/lib/smooth_star_rating.dart +++ b/lib/smooth_star_rating.dart @@ -26,7 +26,6 @@ class SmoothStarRating extends StatelessWidget { } Widget buildStar(BuildContext context, int index) { - final direction = Directionality.of(context); Icon icon; if (index >= rating) { icon = new Icon( @@ -34,7 +33,7 @@ class SmoothStarRating extends StatelessWidget { color: borderColor ?? Theme.of(context).primaryColor, size: size ?? 25.0, ); - } else if (index >= rating - (allowHalfRating ? 0.5 : 1.0) && + } else if (index > rating - (allowHalfRating ? 0.5 : 1.0) && index < rating) { icon = new Icon( Icons.star_half, @@ -56,10 +55,7 @@ class SmoothStarRating extends StatelessWidget { onHorizontalDragUpdate: (dragDetails) { RenderBox box = context.findRenderObject(); var _pos = box.globalToLocal(dragDetails.globalPosition); - var i = ((direction == TextDirection.rtl) - ? (box.size.width - _pos.dx) - : _pos.dx) / - size; + var i = _pos.dx / size; var newRating = allowHalfRating ? i : i.round().toDouble(); if (newRating > starCount) { newRating = starCount.toDouble();