From fa45d26a3b4af4eed881eaa50fd3adaa199ffaee Mon Sep 17 00:00:00 2001 From: CelerityAbbottPC Date: Mon, 19 Jan 2015 05:27:51 -0800 Subject: [PATCH] Fixed the bug where the rating couldn't be zero. --- Chapter_03/lib/component/rating.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Chapter_03/lib/component/rating.dart b/Chapter_03/lib/component/rating.dart index 5ef1fcc..fb5c543 100644 --- a/Chapter_03/lib/component/rating.dart +++ b/Chapter_03/lib/component/rating.dart @@ -59,6 +59,6 @@ class RatingComponent { rating == null || star > rating ? _STAR_OFF_CHAR : _STAR_ON_CHAR; void handleClick(int star) { - rating = (star == 1 && rating == 1) ? 0 : star; + rating = (star == 1 && rating > 0) ? 0 : star; } }