Skip to content

Commit

Permalink
Added support for changing star icon
Browse files Browse the repository at this point in the history
License updated
version incremented
readme file updated
example project now uses androidx
  • Loading branch information
thangmam committed Dec 26, 2019
1 parent 9ee7f83 commit c8f5e2b
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 19 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [1.0.4] - 26/12/2019
### Added support for replacing default stars icon
### The method 'toDouble' was called on null bug fixed

## [1.0.3] - 29/05/2019
### Added support for a spacing between stars

Expand Down
25 changes: 16 additions & 9 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
The MIT License (MIT)

http://www.apache.org/licenses/LICENSE-2.0
Copyright (c) 2019 Thangrobul Infimate

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

A Star rating with touch and swipe rate enabled
* Supports replacing default star icons with desired IconData
* Supports half rate and full rate (1.0 or 0.5)
* Swipe for incrementing/decrementing rate amount
* Change star body and boundary colors independently
Expand All @@ -14,7 +15,7 @@ In your flutter project add the dependency:
```
dependencies:
...
smooth_star_rating: 1.0.3
smooth_star_rating: 1.0.4
```

## Usage example
Expand All @@ -32,6 +33,8 @@ SmoothStarRating(
starCount: 5,
rating: rating,
size: 40.0,
fullRatedIconData: Icons.blur_off,
halfRatedIconData: Icons.blur_on,
color: Colors.green,
borderColor: Colors.green,
spacing:0.0
Expand All @@ -48,6 +51,8 @@ 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)
fullRatedIconData - Full Rated Icon
halfRatedIconData - Half Rated Icon
```

### Screenshots
Expand All @@ -57,4 +62,9 @@ spacing - Spacing between stars(default is 0.0)

#### Half Rating

![alt text](https://raw.githubusercontent.com/thangmam/smoothratingbar/master/screenshots/halfrating.gif "Half Rating")
![alt text](https://raw.githubusercontent.com/thangmam/smoothratingbar/master/screenshots/halfrating.gif "Half Rating")

### MIT LICENSE

### Let me know if you find any bugs/issues.Thanks.
[<img src="https://camo.githubusercontent.com/d5d24e33e2f4b6fe53987419a21b203c03789a8f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d50617950616c2d677265656e2e737667">](https://www.paypal.me/thangmam)
10 changes: 5 additions & 5 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 27
compileSdkVersion 28

lintOptions {
disable 'InvalidPackage'
Expand All @@ -35,10 +35,10 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.example"
minSdkVersion 16
targetSdkVersion 27
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand All @@ -56,6 +56,6 @@ flutter {

dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}
2 changes: 2 additions & 0 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536M
4 changes: 2 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class _MyAppState extends State<MyApp> {
child: SmoothStarRating(
rating: rating,
size: 45,
fullRatedIconData: Icons.bluetooth_audio,
halfRatedIconData: Icons.bluetooth_connected,
fullRatedIconData: Icons.blur_off,
halfRatedIconData: Icons.blur_on,
starCount: 5,
spacing: 2.0,
onRatingChanged: (value) {
Expand Down
2 changes: 2 additions & 0 deletions lib/smooth_star_rating.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ class SmoothStarRating extends StatelessWidget {
final bool allowHalfRating;
final IconData fullRatedIconData;
final IconData halfRatedIconData;
final double spacing;
SmoothStarRating({
this.starCount = 5,
this.spacing,
this.rating = 0.0,
this.onRatingChanged,
this.color,
Expand Down
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.3
version: 1.0.4
author: Thangmam <[email protected]>
homepage: https://github.com/thangmam/smoothratingbar.git

Expand Down

0 comments on commit c8f5e2b

Please sign in to comment.