From 127096ec04e5decf1ef58fd904fb9e16451405bd Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Mon, 22 Nov 2021 12:00:27 +0300 Subject: [PATCH] fixed wishlist design --- lib/widgets/pharmacy/product_tile.dart | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/widgets/pharmacy/product_tile.dart b/lib/widgets/pharmacy/product_tile.dart index 73565ee7..23a6dd9b 100644 --- a/lib/widgets/pharmacy/product_tile.dart +++ b/lib/widgets/pharmacy/product_tile.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/ProductReview.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; @@ -9,6 +10,7 @@ import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; class productTile extends StatelessWidget { @@ -54,6 +56,7 @@ class productTile extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return Container( height: 180, width: double.infinity, @@ -90,7 +93,16 @@ class productTile extends StatelessWidget { children: [ Container( margin: EdgeInsets.all(5), - child: Align( + child: projectViewModel + .isArabic ? Align( + alignment: Alignment.topRight, + child: RichText( + text: TextSpan( + text: productName, + style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold), + ), + ), + ): Align( alignment: Alignment.topLeft, child: RichText( text: TextSpan( @@ -102,7 +114,17 @@ class productTile extends StatelessWidget { ), Container( margin: EdgeInsets.all(5), - child: Align( + child: projectViewModel + .isArabic ? Align( + alignment: Alignment.topRight, + child: RichText( + text: TextSpan( + text: 'SAR $productPrice', + style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13), + ), + ), + ) + :Align( alignment: Alignment.topLeft, child: RichText( text: TextSpan(