Merge branch 'development' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into product_detail_page

merge-requests/415/head
Elham Rababh 3 years ago
commit 7dfc700d26

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -13,14 +13,14 @@ class BestSellerViewModel extends BaseViewModel {
_pharmacyService.bestSellerProducts;
getBestSellerProducts() async {
setState(ViewState.Busy);
setState(ViewState.BusyLocal);
await _pharmacyService.getBestSellerProducts();
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.Error);
} else {
// if (_pharmacyService.hasError) {
// error = _pharmacyService.error;
// setState(ViewState.Error);
// } else {
setState(ViewState.Idle);
}
// }
}
}

@ -11,14 +11,14 @@ class BrandViewModel extends BaseViewModel {
List<Manufacturer> get manufacturerList => _pharmacyService.manufacturerList;
Future getTopManufacturerList() async {
setState(ViewState.Busy);
setState(ViewState.BusyLocal);
await _pharmacyService.getTopManufacturerList();
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.Error);
} else {
// if (_pharmacyService.hasError) {
// error = _pharmacyService.error;
// setState(ViewState.Error);
// } else {
setState(ViewState.Idle);
}
// }
}
@override

@ -15,11 +15,11 @@ class LastVisitedViewModel extends BaseViewModel {
getLastVisitedProducts() async {
setState(ViewState.BusyLocal);
await _pharmacyService.getLastVisitedProducts();
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.Error);
} else {
// if (_pharmacyService.hasError) {
// error = _pharmacyService.error;
// setState(ViewState.Error);
// } else {
setState(ViewState.Idle);
}
// }
}
}

@ -40,7 +40,7 @@ class PharmacyModuleViewModel extends BaseViewModel {
}
Future verifyCustomer() async {
if (authenticatedUserObject.isLogin) await generatePharmacyToken();
// if (authenticatedUserObject.isLogin) await generatePharmacyToken();
var data = await sharedPref.getObject(USER_PROFILE);
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);

@ -825,6 +825,7 @@ class _HomePageState extends State<HomePage> {
} else {
GifLoaderDialogUtils.showMyDialog(context);
await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
await pharmacyModuleViewModel.verifyCustomer().then((value) {
GifLoaderDialogUtils.hideDialog(context);
Navigator.push(context, FadePage(page: LandingPagePharmacy()));

@ -59,7 +59,7 @@ class _BannerPagerState extends State<BannerPager> {
)
: CachedNetworkImage(
imageUrl: item,
fit: BoxFit.cover,
fit: BoxFit.fitWidth,
errorWidget: (context, url, error) =>
SizedBox()),
),

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/BestSellerViewModel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -26,6 +27,7 @@ class BestSellerWidget extends StatelessWidget {
id: "",
productType: 20,
)),
if (model.state != ViewState.BusyLocal)
Container(
height: MediaQuery.of(context).size.height / 4 + 20,
child: ListView.builder(
@ -34,7 +36,18 @@ class BestSellerWidget extends StatelessWidget {
scrollDirection: Axis.horizontal,
itemCount: model.bestSellerProduct.length,
),
),
) else
Container(
height: 80,
child: Center(
child: CircularProgressIndicator(
backgroundColor: Colors.white,
valueColor: AlwaysStoppedAnimation<Color>(
Colors.grey[500],
),
),
),
),
],
),
),

@ -29,10 +29,15 @@ class GridViewCard extends StatelessWidget {
flex: 2,
child: Padding(
padding: const EdgeInsets.all(6),
child: Texts(
text,
color: Colors.white,
fontSize: SizeConfig.textMultiplier * 1.5,
child: Column(
children: [
Texts(
text,
color: Colors.white,
bold: true,
fontSize: SizeConfig.textMultiplier * 1.5,
),
],
),
),
),

@ -18,7 +18,7 @@ class RecentlyViewedWidget extends StatelessWidget {
builder: (_, model, wi) => NetworkBaseView(
isLocalLoader: true,
baseViewModel: model,
child: Container(
child: model.lastVisitedProducts.isNotEmpty ? Container(
child: Column(
children: [
ViewAllHomeWidget(
@ -53,7 +53,7 @@ class RecentlyViewedWidget extends StatelessWidget {
),
],
),
),
) : Container(),
));
}
}

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/BrandViewModel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -15,26 +16,38 @@ class ShopByBrandWidget extends StatelessWidget {
onModelReady: (model) => model.getTopManufacturerList(),
allowAny: true,
builder: (_, model, wi) => NetworkBaseView(
isLocalLoader: true,
baseViewModel: model,
child: Container(
child: Column(
children: [
ViewAllHomeWidget(
TranslationBase.of(context).shopByBrands,
ProductBrandsPage()),
Container(
height: 100,
child: ListView.builder(
itemBuilder: (ctx, i) =>
ManufacturerItem(model.manufacturerList[i]),
scrollDirection: Axis.horizontal,
itemCount: model.manufacturerList.length,
),
isLocalLoader: true,
baseViewModel: model,
child: Container(
child: Column(
children: [
ViewAllHomeWidget(TranslationBase.of(context).shopByBrands,
ProductBrandsPage()),
if (model.state != ViewState.BusyLocal)
Container(
height: 100,
child: ListView.builder(
itemBuilder: (ctx, i) =>
ManufacturerItem(model.manufacturerList[i]),
scrollDirection: Axis.horizontal,
itemCount: model.manufacturerList.length,
),
)
else
Container(
height: 80,
child: Center(
child: CircularProgressIndicator(
backgroundColor: Colors.white,
valueColor: AlwaysStoppedAnimation<Color>(
Colors.grey[500],
),
),
),
),
],
),
],
),
),
));
),
));
}
}
}

@ -21,14 +21,16 @@ class ViewAllHomeWidget extends StatelessWidget {
Texts(
title,
bold: true,
fontSize: 16,
),
BorderedButton(
TranslationBase.of(context).viewAll,
hasBorder: true,
borderColor: Colors.green,
textColor: Colors.green,
fontWeight: FontWeight.bold,
vPadding: 6,
hPadding: 8,
hPadding: 14,
handler: () {
Navigator.push(
context,

@ -3,12 +3,12 @@ import 'package:flutter/material.dart';
class GestureIconButton extends StatefulWidget {
GestureIconButton(
this.label,
this.icon, {
Key key,
this.onTap,
this.backgroundColor,
}) : super(key: key);
this.label,
this.icon, {
Key key,
this.onTap,
this.backgroundColor,
}) : super(key: key);
final String label;
final Widget icon;
@ -29,41 +29,35 @@ class _GestureIconButtonState extends State<GestureIconButton> {
setState(() => _buttonLongPress = !_buttonLongPress),
onLongPressEnd: (_) =>
setState(() => _buttonLongPress = !_buttonLongPress),
child: Wrap(
children: [
Container(
decoration: BoxDecoration(
border: Border.all(
color: widget.backgroundColor != null
? widget.backgroundColor
: Colors.grey[200],
child: Container(
decoration: BoxDecoration(
border: Border.all(
color: widget.backgroundColor != null
? widget.backgroundColor
: Colors.grey[200],
),
color: widget.backgroundColor != null
? widget.backgroundColor
: Colors.grey.shade200,
borderRadius: BorderRadius.all(Radius.circular(8))),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: widget.icon,
),
color: widget.backgroundColor != null
? widget.backgroundColor
: Colors.grey.shade200,
borderRadius: BorderRadius.all(Radius.circular(8))),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Expanded(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: const EdgeInsets.only(right: 8.0),
child: widget.icon,
),
Texts(
widget.label,
color: _buttonLongPress ? Colors.white : Colors.black,
),
],
),
Texts(
widget.label,
color: _buttonLongPress ? Colors.white : Colors.black,
),
),
],
),
),
],
),
),
);
}

Loading…
Cancel
Save