diff --git a/README.md b/README.md index 3f77ed6..5179ef9 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/lib/cart.dart b/lib/cart.dart index cc98606..575f02d 100644 --- a/lib/cart.dart +++ b/lib/cart.dart @@ -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 diff --git a/lib/product_detail.dart b/lib/product_detail.dart index 2bb7e10..2d33704 100644 --- a/lib/product_detail.dart +++ b/lib/product_detail.dart @@ -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 @@ -75,24 +75,12 @@ class Products extends StatelessWidget { ), Row( children: [ - 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, + ) ], ), ], diff --git a/lib/shop/shop.dart b/lib/shop/shop.dart index fe1f8b1..0832c94 100644 --- a/lib/shop/shop.dart +++ b/lib/shop/shop.dart @@ -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'; @@ -129,25 +129,11 @@ class _ShopState extends State { ), Row( children: [ - 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, ) ], ) @@ -227,25 +213,11 @@ class _ShopState extends State { ), Row( children: [ - 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, ) ], ) diff --git a/lib/wishlist.dart b/lib/wishlist.dart index 5d3c26a..5b9d685 100644 --- a/lib/wishlist.dart +++ b/lib/wishlist.dart @@ -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 @@ -142,21 +142,11 @@ class _WishlistState extends State { ), Row( children: [ - 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, ) ], ) diff --git a/pubspec.lock b/pubspec.lock index 72f45ee..5bc7731 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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: @@ -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: diff --git a/pubspec.yaml b/pubspec.yaml index 2db8bc6..f641fb3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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