fix widget of product_tile

merge-requests/226/merge
enadhilal 6 years ago
parent d6d1c26c9a
commit 7ca6e6caa7

@ -33,7 +33,7 @@ class _WishlistPageState extends State<WishlistPage> {
return Column(
children: [
Container(
child: productTile(),
child: productTile(productName: 'Panadol Extra 500 MG', productPrice: '10.00', productRate: 3.00,),
),
Divider(height: 1, color: Colors.grey)
],

@ -4,7 +4,16 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:rating_bar/rating_bar.dart';
productTile() {
class productTile extends StatelessWidget {
final String productName;
final String productPrice;
final double productRate;
productTile({this.productName, this.productPrice, this.productRate});
@override
Widget build(BuildContext context) {
return Container(
height: 120,
width: double.infinity,
@ -36,7 +45,7 @@ productTile() {
child: RichText(
text: TextSpan(
text:
'Dulcolax 5 Mg 30 Tablets asdfasdfadsf asdfasdfas dasd fasdf asd fasdfsad',
productName,
style: TextStyle(
color: Colors.black54,
fontSize: 15,
@ -51,7 +60,7 @@ productTile() {
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: 'SAR 9999.99',
text: 'SAR $productPrice',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
@ -65,7 +74,7 @@ productTile() {
child: Align(
alignment: Alignment.topLeft,
child: RatingBar.readOnly(
initialRating: 3,
initialRating: productRate,
size: 15.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
@ -94,4 +103,5 @@ productTile() {
],
),
);
}
}
Loading…
Cancel
Save