fix widget of product_tile

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

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

@ -4,94 +4,104 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
productTile() {
return Container( class productTile extends StatelessWidget {
height: 120, final String productName;
width: double.infinity, final String productPrice;
color: Colors.white, final double productRate;
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, productTile({this.productName, this.productPrice, this.productRate});
mainAxisAlignment: MainAxisAlignment.center,
children: [ @override
Row( Widget build(BuildContext context) {
children: [ return Container(
Container( height: 120,
margin: EdgeInsets.only(left: 10), width: double.infinity,
child: Image( color: Colors.white,
image: child: Column(
AssetImage('assets/images/al-habib_onlne_pharmacy_bg.png'), crossAxisAlignment: CrossAxisAlignment.start,
fit: BoxFit.cover, mainAxisAlignment: MainAxisAlignment.center,
width: 80, children: [
height: 80, 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(
Expanded( flex: 5,
flex: 5, child: Column(
child: Column( children: [
children: [ Container(
Container( margin: EdgeInsets.all(5),
margin: EdgeInsets.all(5), child: Align(
child: Align( alignment: Alignment.topLeft,
alignment: Alignment.topLeft, child: RichText(
child: RichText( text: TextSpan(
text: TextSpan( text:
text: productName,
'Dulcolax 5 Mg 30 Tablets asdfasdfadsf asdfasdfas dasd fasdf asd fasdfsad', style: TextStyle(
style: TextStyle( color: Colors.black54,
color: Colors.black54, fontSize: 15,
fontSize: 15, fontWeight: FontWeight.bold),
fontWeight: FontWeight.bold), ),
), ),
), ),
), ),
), Container(
Container( margin: EdgeInsets.all(5),
margin: EdgeInsets.all(5), child: Align(
child: Align( alignment: Alignment.topLeft,
alignment: Alignment.topLeft, child: RichText(
child: RichText( text: TextSpan(
text: TextSpan( text: 'SAR $productPrice',
text: 'SAR 9999.99', style: TextStyle(
style: TextStyle( fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, color: Colors.black,
color: Colors.black, fontSize: 13),
fontSize: 13), ),
), ),
), ),
), ),
), Container(
Container( margin: EdgeInsets.all(5),
margin: EdgeInsets.all(5), child: Align(
child: Align( alignment: Alignment.topLeft,
alignment: Alignment.topLeft, child: RatingBar.readOnly(
child: RatingBar.readOnly( initialRating: productRate,
initialRating: 3, size: 15.0,
size: 15.0, filledColor: Colors.yellow[700],
filledColor: Colors.yellow[700], emptyColor: Colors.grey[500],
emptyColor: Colors.grey[500], isHalfAllowed: true,
isHalfAllowed: true, halfFilledIcon: Icons.star_half,
halfFilledIcon: Icons.star_half, filledIcon: Icons.star,
filledIcon: Icons.star, emptyIcon: Icons.star,
emptyIcon: Icons.star, ),
), ),
), ),
), ],
], ),
), ),
), Expanded(
Expanded( flex: 1,
flex: 1, child: Column(
child: Column( children: [
children: [ Icon(FontAwesomeIcons.trashAlt, size: 15),
Icon(FontAwesomeIcons.trashAlt, size: 15), SizedBox(height: 50,),
SizedBox(height: 50,), Icon(FontAwesomeIcons.shoppingCart, size: 15),
Icon(FontAwesomeIcons.shoppingCart, size: 15), ],
], ),
), ),
), ],
], ),
), ],
], ),
), );
); }
} }

Loading…
Cancel
Save