Skip to content

Commit

Permalink
Revert "Merge branch 'p30arena-patch-1' into dev"
Browse files Browse the repository at this point in the history
This reverts commit e2ac09d, reversing
changes made to 394aabd.
  • Loading branch information
thangmam committed Dec 26, 2019
1 parent e2ac09d commit 01c950f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/smooth_star_rating.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ class SmoothStarRating extends StatelessWidget {
}

Widget buildStar(BuildContext context, int index) {
final direction = Directionality.of(context);
Icon icon;
if (index >= rating) {
icon = new Icon(
Icons.star_border,
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,
Expand All @@ -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();
Expand Down

0 comments on commit 01c950f

Please sign in to comment.