|
|
|
|
@ -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),
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|