Skip to content

Commit

Permalink
added spacing between stars
Browse files Browse the repository at this point in the history
updated updated pubspec version
updated readme file
updated changelog
updtaed example file
  • Loading branch information
thangmam committed May 29, 2019
1 parent 2968057 commit 160de63
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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."

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,6 +34,7 @@ SmoothStarRating(
size: 40.0,
color: Colors.green,
borderColor: Colors.green,
spacing:0.0
)
```

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class _MyAppState extends State<MyApp> {
rating: rating,
size: 45,
starCount: 5,
spacing: 2.0,
onRatingChanged: (value) {
setState(() {
rating = value;
Expand Down
4 changes: 3 additions & 1 deletion lib/smooth_star_rating.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
library smooth_star_rating;

import 'package:flutter/material.dart';
import 'package:flutter/material.dart';

typedef void RatingChangeCallback(double rating);
Expand All @@ -13,6 +12,7 @@ class SmoothStarRating extends StatelessWidget {
final Color borderColor;
final double size;
final bool allowHalfRating;
final double spacing;

SmoothStarRating(
{this.starCount = 5,
Expand All @@ -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);
}
Expand Down Expand Up @@ -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))),
);
Expand Down
15 changes: 11 additions & 4 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: smooth_star_rating
description: A smooth rating bar
version: 1.0.2
version: 1.0.3
author: Thangmam <infimatet@gmail.com>
homepage: https://github.com/thangmam/smoothratingbar.git

Expand Down

0 comments on commit 160de63

Please sign in to comment.