diff --git a/lib/pages/pharmacies/wishlist.dart b/lib/pages/pharmacies/wishlist.dart index 3c8942b7..8fa7352d 100644 --- a/lib/pages/pharmacies/wishlist.dart +++ b/lib/pages/pharmacies/wishlist.dart @@ -33,7 +33,7 @@ class _WishlistPageState extends State { 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) ], diff --git a/lib/widgets/pharmacy/product_tile.dart b/lib/widgets/pharmacy/product_tile.dart index 4a33a1f6..3fa93363 100644 --- a/lib/widgets/pharmacy/product_tile.dart +++ b/lib/widgets/pharmacy/product_tile.dart @@ -4,94 +4,104 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:rating_bar/rating_bar.dart'; -productTile() { - return Container( - height: 120, - width: double.infinity, - color: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(left: 10), - child: Image( - image: - AssetImage('assets/images/al-habib_onlne_pharmacy_bg.png'), - fit: BoxFit.cover, - width: 80, - height: 80, + +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, + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Container( + margin: EdgeInsets.only(left: 10), + child: Image( + image: + AssetImage('assets/images/al-habib_onlne_pharmacy_bg.png'), + fit: BoxFit.cover, + width: 80, + height: 80, + ), ), - ), - Expanded( - flex: 5, - child: Column( - children: [ - Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RichText( - text: TextSpan( - text: - 'Dulcolax 5 Mg 30 Tablets asdfasdfadsf asdfasdfas dasd fasdf asd fasdfsad', - style: TextStyle( - color: Colors.black54, - fontSize: 15, - fontWeight: FontWeight.bold), + Expanded( + flex: 5, + child: Column( + children: [ + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: + productName, + style: TextStyle( + color: Colors.black54, + fontSize: 15, + fontWeight: FontWeight.bold), + ), ), ), ), - ), - Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RichText( - text: TextSpan( - text: 'SAR 9999.99', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: 13), + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RichText( + text: TextSpan( + text: 'SAR $productPrice', + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: 13), + ), ), ), ), - ), - Container( - margin: EdgeInsets.all(5), - child: Align( - alignment: Alignment.topLeft, - child: RatingBar.readOnly( - initialRating: 3, - size: 15.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, + Container( + margin: EdgeInsets.all(5), + child: Align( + alignment: Alignment.topLeft, + child: RatingBar.readOnly( + initialRating: productRate, + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), ), ), - ), - ], + ], + ), ), - ), - Expanded( - flex: 1, - child: Column( - children: [ - Icon(FontAwesomeIcons.trashAlt, size: 15), - SizedBox(height: 50,), - Icon(FontAwesomeIcons.shoppingCart, size: 15), - ], + Expanded( + flex: 1, + child: Column( + children: [ + Icon(FontAwesomeIcons.trashAlt, size: 15), + SizedBox(height: 50,), + Icon(FontAwesomeIcons.shoppingCart, size: 15), + ], + ), ), - ), - ], - ), - ], - ), - ); -} \ No newline at end of file + ], + ), + ], + ), + ); + } +}