merge-requests/414/head
Elham Rababh 4 years ago
parent ad0c8eaffb
commit 7c15bca746

@ -11,11 +11,11 @@ class IconWithBg extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(left: 25),
// margin: EdgeInsets.only(left: 25),
width: 40,
height: 40,
decoration: BoxDecoration(
color: Colors.grey[300],
color: Colors.grey[200],
borderRadius: BorderRadius.circular(30),
),
child: IconButton(

@ -1,6 +1,11 @@
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import '../../compare-list.dart';
import '../cart-order-page.dart';
import 'CustomIcon.dart';
@ -9,58 +14,108 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
Widget build(BuildContext context) {
return Container(
color: Colors.white,
child: Column(
children: [
SizedBox(
height: 30,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
IconWithBg(
icon: Icons.arrow_back_ios,
color: Colors.grey,
onPress: () {
Navigator.pop(context);
},
),
],
),
Row(
children: [
IconWithBg(
icon: Icons.shopping_cart,
child: FractionallySizedBox(
widthFactor: 0.95,
child: Column(
children: [
SizedBox(
height: 30,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
IconWithBg(
icon: Icons.arrow_back_ios,
color: Colors.grey,
onPress: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CartOrderPage()),
);
}),
IconWithBg(
icon: FontAwesomeIcons.ellipsisV,
color: Colors.grey,
onPress: () {
//TODO Elham*
// settingModalBottomSheet(context);
},
),
],
)
],
),
],
Navigator.pop(context);
},
),
],
),
Row(
children: [
IconWithBg(
icon: Icons.shopping_cart,
color: Colors.grey,
onPress: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CartOrderPage()),
);
}),
SizedBox(width: 10,),
IconWithBg(
icon: FontAwesomeIcons.ellipsisV,
color: Colors.grey,
onPress: () {
settingModalBottomSheet(context);
},
),
],
)
],
),
],
),
),
);
}
@override
// TODO: implement preferredSize
@override
Size get preferredSize => Size(double.maxFinite, 50);
settingModalBottomSheet(context) {
showModalBottomSheet(
context: context,
builder: (BuildContext bc) {
return Container(
child: new Wrap(
children: <Widget>[
new ListTile(
leading: Icon(Icons.shopping_cart),
title: Text(
TranslationBase.of(context).addToCart,
),
onTap: () => {
if (price > 0)
{addToCartFunction(price, itemID, context)}
else
{
AppToast.showErrorToast(
message: "you should add quantity")
}
}),
ListTile(
leading: Icon(Icons.favorite_border),
title: Text(
TranslationBase.of(context).addToWishlist,
),
onTap: () => {addToWishlistFunction(itemID)},
),
ListTile(
leading: Icon(Icons.compare),
title: Text(
TranslationBase.of(context).compare,
),
onTap: () => {
Provider.of<CompareList>(context, listen: false)
.addItem(specificationData),
},
),
],
),
);
});
}
}

@ -178,7 +178,7 @@ class _FooterWidgetState extends State<FooterWidget> {
),
),
Container(
width: MediaQuery.of(context).size.width * 0.4,
width: MediaQuery.of(context).size.width * 0.45,
child: SecondaryButton(
label: TranslationBase.of(context).addToCart.toUpperCase(),
disabled: !widget.isAvailable && widget.price > 0 ||
@ -188,6 +188,7 @@ class _FooterWidgetState extends State<FooterWidget> {
widget.addToCartFunction(
widget.price, widget.item.id, context);
},
borderRadius: 5,
color: Colors.green,
),
@ -196,7 +197,7 @@ class _FooterWidgetState extends State<FooterWidget> {
width: 5,
),
Container(
width: MediaQuery.of(context).size.width * 0.3,
width: MediaQuery.of(context).size.width * 0.35,
child: SecondaryButton(
label: TranslationBase.of(context).buyNow.toUpperCase(),
disabled: !widget.isAvailable && widget.price > 0 ||

@ -112,7 +112,7 @@ class __ProductDetailPageState extends State<ProductDetailPage>
isShowAppBar: true,
isPharmacy: true,
isShowDecPage: false,
customAppBar: ProductAppBar(),
customAppBar: ProductAppBar(),
body: SingleChildScrollView(
child: Column(
children: [
@ -143,9 +143,17 @@ class __ProductDetailPageState extends State<ProductDetailPage>
context,
widget.product,
customerId: customerId,
addToWishlistFunction: addToWishlistFunction,
deleteFromWishlistFunction: deleteFromWishlistFunction,
notifyMeWhenAvailable: notifyMeWhenAvailable,
addToWishlistFunction: (item) {
addToWishlistFunction(item);
setState(() {});
},
deleteFromWishlistFunction: (item) {
deleteFromWishlistFunction(item);
setState(() {});
},
notifyMeWhenAvailable: (context, itemId) {
notifyMeWhenAvailable(context, itemId);
},
isInWishList: isInWishList,
),
),

@ -46,7 +46,7 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(widget.item.price.toString() + " " + "SAR",
Texts(widget.item.price.toString() + " " + "SR",
fontWeight: FontWeight.bold, fontSize: 20),
Texts(
projectViewModel.isArabic

Loading…
Cancel
Save