|
|
|
|
@ -1,8 +1,11 @@
|
|
|
|
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/pharmacy/categorise_parent_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/locator.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/sub_categorise_page.dart';
|
|
|
|
|
@ -22,10 +25,14 @@ import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/sub_categories_modalsheet.dart';
|
|
|
|
|
import 'base/base_view.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ParentCategorisePage extends StatefulWidget {
|
|
|
|
|
String id;
|
|
|
|
|
String titleName;
|
|
|
|
|
|
|
|
|
|
AuthenticatedUserObject authenticatedUserObject =
|
|
|
|
|
locator<AuthenticatedUserObject>();
|
|
|
|
|
|
|
|
|
|
ParentCategorisePage({this.id, this.titleName});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
@ -38,7 +45,9 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
|
|
|
|
|
String titleName;
|
|
|
|
|
final dynamic productID;
|
|
|
|
|
|
|
|
|
|
_ParentCategorisePageState({this.id, this.titleName, this.productID});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_ParentCategorisePageState({this.id, this.titleName, this.productID,});
|
|
|
|
|
|
|
|
|
|
Map<String, bool> values = {'huusam': false, 'ali': false, 'noor': false};
|
|
|
|
|
bool checkedBrands = false;
|
|
|
|
|
@ -1157,6 +1166,8 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
widget.authenticatedUserObject.isLogin ?
|
|
|
|
|
Container(
|
|
|
|
|
child: IconButton(
|
|
|
|
|
icon: Icon(Icons.shopping_cart,
|
|
|
|
|
@ -1164,15 +1175,15 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
|
|
|
|
|
color: Colors.blue,),
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await addToCartFunction(1, productID);
|
|
|
|
|
await addToCartFunction(1, model.parentProducts[index].id);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(page: CartOrderPage()),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
): Container(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -1220,6 +1231,13 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addToCartFunction(quantity, itemID) async {
|
|
|
|
|
ProductDetailViewModel x = new ProductDetailViewModel();
|
|
|
|
|
await x.addToCartData(quantity, itemID);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool isEntityListSelected(CategoriseParentModel masterKey) {
|
|
|
|
|
@ -1240,8 +1258,6 @@ class _ParentCategorisePageState extends State<ParentCategorisePage> {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addToCartFunction(quantity, itemID) async {
|
|
|
|
|
ProductDetailViewModel x = new ProductDetailViewModel();
|
|
|
|
|
await x.addToCartData(quantity, itemID);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|