Skip to content

Commit

Permalink
Merge pull request #8 from Furqankhanzada/ratings
Browse files Browse the repository at this point in the history
feature: updated rating plugin due to null safety support and readme error
  • Loading branch information
Furqankhanzada authored Jul 6, 2021
2 parents 500c4a0 + cc13821 commit e42838d
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 84 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ If you find any problems, please [open an issue](https://github.com/Furqankhanza

## License

[MIT License](LICENSE)
[MIT License](LICENSE.txt)
1 change: 0 additions & 1 deletion lib/cart.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:smooth_star_rating/smooth_star_rating.dart';

class CartList extends StatefulWidget {
@override
Expand Down
26 changes: 7 additions & 19 deletions lib/product_detail.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:smooth_star_rating/smooth_star_rating.dart';
import 'package:flutter_rating_stars/flutter_rating_stars.dart';

class Products extends StatelessWidget {
@override
Expand Down Expand Up @@ -75,24 +75,12 @@ class Products extends StatelessWidget {
),
Row(
children: <Widget>[
SmoothStarRating(
allowHalfRating: false,
starCount: 5,
size: 20.0,
color: Colors.amber,
borderColor: Colors.amber,
spacing: -0.8
),
Padding(
padding: const EdgeInsets.only(left: 10.0),
child: Text(
'(0.00)',
style: TextStyle(
color: Colors.black,
fontSize: 16,
)
),
),
RatingStars(
value: 5,
starSize: 16,
valueLabelColor: Colors.amber,
starColor: Colors.amber,
)
],
),
],
Expand Down
50 changes: 11 additions & 39 deletions lib/shop/shop.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:smooth_star_rating/smooth_star_rating.dart';
import 'package:flutter_rating_stars/flutter_rating_stars.dart';

import 'search.dart';

Expand Down Expand Up @@ -129,25 +129,11 @@ class _ShopState extends State<Shop> {
),
Row(
children: <Widget>[
SmoothStarRating(
allowHalfRating: false,
onRated: (v) {
product['rating'] = v;
setState(() {});
},
starCount: 5,
rating: product['rating'],
size: 16.0,
color: Colors.amber,
borderColor: Colors.amber,
spacing:0.0
),
Padding(
padding: const EdgeInsets.only(left: 6.0),
child: Text('(4)', style: TextStyle(
fontWeight: FontWeight.w300,
color: Theme.of(context).primaryColor
)),
RatingStars(
value: product['rating'],
starSize: 16,
valueLabelColor: Colors.amber,
starColor: Colors.amber,
)
],
)
Expand Down Expand Up @@ -227,25 +213,11 @@ class _ShopState extends State<Shop> {
),
Row(
children: <Widget>[
SmoothStarRating(
allowHalfRating: false,
onRated: (v) {
products[index]['rating'] = v;
setState(() {});
},
starCount: 5,
rating: products[index]['rating'],
size: 16.0,
color: Colors.amber,
borderColor: Colors.amber,
spacing:0.0
),
Padding(
padding: const EdgeInsets.only(left: 6.0),
child: Text('(4)', style: TextStyle(
fontWeight: FontWeight.w300,
color: Theme.of(context).primaryColor
)),
RatingStars(
value: products[index]['rating'],
starSize: 16,
valueLabelColor: Colors.amber,
starColor: Colors.amber,
)
],
)
Expand Down
22 changes: 6 additions & 16 deletions lib/wishlist.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:smooth_star_rating/smooth_star_rating.dart';
import 'package:flutter_rating_stars/flutter_rating_stars.dart';

class WishList extends StatefulWidget {
@override
Expand Down Expand Up @@ -142,21 +142,11 @@ class _WishlistState extends State<WishList> {
),
Row(
children: <Widget>[
SmoothStarRating(
allowHalfRating: false,
starCount: 5,
rating: item['rating'],
size: 16.0,
color: Colors.amber,
borderColor: Colors.amber,
spacing:0.0
),
Padding(
padding: const EdgeInsets.only(left: 6.0),
child: Text('(4)', style: TextStyle(
fontWeight: FontWeight.w300,
color: Theme.of(context).primaryColor
)),
RatingStars(
value: item['rating'],
starSize: 16,
valueLabelColor: Colors.amber,
starColor: Colors.amber,
)
],
)
Expand Down
14 changes: 7 additions & 7 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_rating_stars:
dependency: "direct main"
description:
name: flutter_rating_stars
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3+4"
flutter_secure_storage:
dependency: "direct main"
description:
Expand Down Expand Up @@ -285,13 +292,6 @@ packages:
description: flutter
source: sdk
version: "0.0.99"
smooth_star_rating:
dependency: "direct main"
description:
name: smooth_star_rating
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
source_span:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies:
intl: ^0.17.0
carousel_slider: ^4.0.0
cached_network_image: ^3.0.0
smooth_star_rating: ^1.1.1
flutter_rating_stars: ^1.0.3+4
provider: ^5.0.0
flutter_secure_storage: ^4.2.0
fluttertoast: ^8.0.7
Expand Down

0 comments on commit e42838d

Please sign in to comment.