|
|
|
|
@ -1,9 +1,11 @@
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
|
|
|
|
|
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:diplomaticquarterapp/widgets/data_display/text.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
@ -63,16 +65,34 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
|
|
|
|
|
if (authenticatedUserObject.isLogin)
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
IconWithBg(
|
|
|
|
|
icon: Icons.shopping_cart,
|
|
|
|
|
color: Colors.grey[800],
|
|
|
|
|
onPress: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => CartOrderPage()),
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
Stack(
|
|
|
|
|
children: [
|
|
|
|
|
IconWithBg(
|
|
|
|
|
icon: Icons.shopping_cart,
|
|
|
|
|
color: Colors.grey[800],
|
|
|
|
|
onPress: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => CartOrderPage()),
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
|
|
if(Provider.of<OrderPreviewViewModel>(context, listen: false).cartResponse.quantityCount !=0)
|
|
|
|
|
Positioned(
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
borderRadius: BorderRadius.circular(15),
|
|
|
|
|
|
|
|
|
|
),
|
|
|
|
|
padding: EdgeInsets.only(left: 5, right: 4.5),
|
|
|
|
|
height: 18,
|
|
|
|
|
child: Center(child: Texts(Provider.of<OrderPreviewViewModel>(context, listen: false).cartResponse.quantityCount.toString(), style: "caption", medium: true, color: Colors.white,)),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 10,
|
|
|
|
|
),
|
|
|
|
|
|