Merge branch 'brands' into 'development'

Brands

See merge request Cloud_Solution/diplomatic-quarter!396
merge-update-with-lab-changes
Mohammad Aljammal 5 years ago
commit edffa96925

@ -121,9 +121,9 @@ class PharmacyModuleService extends BaseService {
manufacturerList.clear(); manufacturerList.clear();
response['manufacturer'].forEach((item) { response['manufacturer'].forEach((item) {
Manufacturer manufacturer = Manufacturer.fromJson(item); Manufacturer manufacturer = Manufacturer.fromJson(item);
if (manufacturer.image != null) { // if (manufacturer.image != null) {
manufacturerList.add(Manufacturer.fromJson(item)); manufacturerList.add(Manufacturer.fromJson(item));
} // }
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -329,6 +329,7 @@ class PharmacyCategoriseService extends BaseService {
} }
Future getMostViewedProducts() async { Future getMostViewedProducts() async {
hasError = false;
Map<String, String> queryParams = { Map<String, String> queryParams = {
'fields': 'fields':
'id,discount_ids,name,reviews,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage', 'id,discount_ids,name,reviews,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage',
@ -346,7 +347,9 @@ class PharmacyCategoriseService extends BaseService {
super.error = error; super.error = error;
}, queryParams: queryParams); }, queryParams: queryParams);
} catch (error) { } catch (error) {
throw error; hasError = true;
super.error = error.toString();
// throw error;
} }
} }

@ -49,6 +49,8 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<PharmacyCategoriseViewModel>( return BaseView<PharmacyCategoriseViewModel>(
onModelReady: (model) { onModelReady: (model) {
//TODO Elham* fix all services in order handel errors in better way in the service
if (widget.productType == 1) { if (widget.productType == 1) {
model.getFinalProducts(i: id); model.getFinalProducts(i: id);
} else if (widget.productType == 2) { } else if (widget.productType == 2) {
@ -71,7 +73,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
isBottomBar: false, isBottomBar: false,
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
isShowDecPage: false, isShowDecPage: true,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(
height: MediaQuery.of(context).size.height * 5.87, height: MediaQuery.of(context).size.height * 5.87,

@ -93,12 +93,10 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
if (customerId != null) { if (customerId != null) {
itemID = widget.product.id; itemID = widget.product.id;
checkWishlist(); checkWishlist();
// getSpecificationData(itemID);
} }
print("customerId:$customerId"); print("customerId:$customerId");
setState(() {}); setState(() {});
// getSpecificationData(itemID);
} }
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -943,6 +941,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
isShowDecPage: false, isShowDecPage: false,
showPharmacyCart: false,
showHomeAppBarIcon: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [

@ -590,7 +590,7 @@ class _PharmacyPageState extends State<PharmacyPage> {
), ),
), ),
Container( Container(
height: 60, height: 100,
child: ListView.builder( child: ListView.builder(
itemBuilder: (ctx, i) => itemBuilder: (ctx, i) =>
ManufacturerItem(model.manufacturerList[i]), ManufacturerItem(model.manufacturerList[i]),
@ -662,7 +662,8 @@ class _PharmacyPageState extends State<PharmacyPage> {
FadePage( FadePage(
page: FinalProductsPage( page: FinalProductsPage(
id: "", id: "",
productType: 4, //TODO Elham* handel this to understans form where the number comming
productType: 20,
), ),
), ),
), ),

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -23,28 +24,31 @@ class ManufacturerItem extends StatelessWidget {
), ),
); );
}, },
child: Card( child: Container(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
horizontal: 8, horizontal: 12,
vertical: 4, vertical: 4,
), ),
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( borderRadius:BorderRadius.circular(12) ,
border: Border( border: Border(
right: BorderSide(color: Colors.grey.shade300, width: 1), right: BorderSide(color: Colors.grey.shade300, width: 1),
bottom: BorderSide(color: Colors.grey.shade300, width: 1), bottom: BorderSide(color: Colors.grey.shade300, width: 1),
left: BorderSide(color: Colors.grey.shade300, width: 1), left: BorderSide(color: Colors.grey.shade300, width: 1),
top: BorderSide(color: Colors.grey.shade300, width: 1)), top: BorderSide(color: Colors.grey.shade300, width: 1)),
),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: Image.network(
item.image.src,
fit: BoxFit.cover,
),
),
), ),
child: item.image == null
? Padding(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 10),
child: AppText(item.name, fontWeight: FontWeight.w500,fontSize: 14,),
)
: Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: Image.network(
item.image.src,
fit: BoxFit.cover,
),
),
), ),
); );
} }

@ -183,20 +183,6 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
), ),
centerTitle: true, centerTitle: true,
actions: <Widget>[ actions: <Widget>[
isPharmacy
? IconButton(
icon: Icon(Icons.shopping_cart),
color: Colors.grey,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CartOrderPage()),
);
// Navigator.of(context)
// .popUntil(ModalRoute.withName('/'));
})
: Container(),
image != null image != null
? InkWell( ? InkWell(
onTap: () => Navigator.push( onTap: () => Navigator.push(

Loading…
Cancel
Save