From 160de6305b6dadb08aa05f1598d8ea4c65124707 Mon Sep 17 00:00:00 2001 From: thangrobul infimate Date: Wed, 29 May 2019 07:21:49 +0530 Subject: [PATCH] added spacing between stars updated updated pubspec version updated readme file updated changelog updtaed example file --- CHANGELOG.md | 3 +++ README.md | 6 +++++- example/lib/main.dart | 1 + lib/smooth_star_rating.dart | 4 +++- pubspec.lock | 15 +++++++++++---- pubspec.yaml | 2 +- 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 608b251..70f02be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [1.0.3] - 29/05/2019 +### Added support for a spacing between stars + ## [1.0.2] - 29/03/2019 ### assertion added for checking nullability of rating variable which causes the exception "The method '_greaterThanFromInteger' was called on null." diff --git a/README.md b/README.md index 35e32a7..2fbf5ce 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,15 @@ A Star rating with touch and swipe rate enabled * Control size of the star rating * Set your desired total Star count * Supports click-to-rate +* Spacing between stars + ## Getting Started In your flutter project add the dependency: ``` dependencies: ... - smooth_star_rating: 1.0.2 + smooth_star_rating: 1.0.3 ``` ## Usage example @@ -32,6 +34,7 @@ SmoothStarRating( size: 40.0, color: Colors.green, borderColor: Colors.green, + spacing:0.0 ) ``` @@ -44,6 +47,7 @@ rating - The current value of rating size - The size of a single star color - The body color of star borderColor - The border color of star +spacing - Spacing between stars(default is 0.0) ``` ### Screenshots diff --git a/example/lib/main.dart b/example/lib/main.dart index 9d0ddb2..dec1687 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -25,6 +25,7 @@ class _MyAppState extends State { rating: rating, size: 45, starCount: 5, + spacing: 2.0, onRatingChanged: (value) { setState(() { rating = value; diff --git a/lib/smooth_star_rating.dart b/lib/smooth_star_rating.dart index abb546e..1397b2b 100644 --- a/lib/smooth_star_rating.dart +++ b/lib/smooth_star_rating.dart @@ -1,6 +1,5 @@ library smooth_star_rating; -import 'package:flutter/material.dart'; import 'package:flutter/material.dart'; typedef void RatingChangeCallback(double rating); @@ -13,6 +12,7 @@ class SmoothStarRating extends StatelessWidget { final Color borderColor; final double size; final bool allowHalfRating; + final double spacing; SmoothStarRating( {this.starCount = 5, @@ -21,6 +21,7 @@ class SmoothStarRating extends StatelessWidget { this.color, this.borderColor, this.size, + this.spacing = 0.0, this.allowHalfRating = true}) { assert(this.rating != null); } @@ -75,6 +76,7 @@ class SmoothStarRating extends StatelessWidget { color: Colors.transparent, child: new Wrap( alignment: WrapAlignment.start, + spacing: spacing, children: new List.generate( starCount, (index) => buildStar(context, index))), ); diff --git a/pubspec.lock b/pubspec.lock index 224c7bb..ea890ff 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -60,6 +60,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.6.2" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.0" quiver: dependency: transitive description: @@ -78,7 +85,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.4.1" + version: "1.5.4" stack_trace: dependency: transitive description: @@ -106,14 +113,14 @@ packages: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.1.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.1" + version: "0.2.2" typed_data: dependency: transitive description: @@ -129,4 +136,4 @@ packages: source: hosted version: "2.0.8" sdks: - dart: ">=2.0.0 <3.0.0" + dart: ">=2.1.0 <3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index dc8ecfe..f187742 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: smooth_star_rating description: A smooth rating bar -version: 1.0.2 +version: 1.0.3 author: Thangmam homepage: https://github.com/thangmam/smoothratingbar.git