fixed issues

enad_pharmacy2
enadhilal 5 years ago
parent 60648d368f
commit 0c6fb67718

@ -462,7 +462,8 @@ class BaseAppClient {
body: json.encode(body), body: json.encode(body),
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json' 'Accept': 'application/json',
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
}); });
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
print("statusCode :$statusCode"); print("statusCode :$statusCode");

@ -27,7 +27,6 @@ class ProductDetailViewModel extends BaseViewModel{
Future getProductReviewsData(productID) async { Future getProductReviewsData(productID) async {
print('ENAD REview');
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);
await _productDetailService.getProductReviews(productID); await _productDetailService.getProductReviews(productID);
@ -39,7 +38,6 @@ class ProductDetailViewModel extends BaseViewModel{
} }
Future getProductLocationData() async { Future getProductLocationData() async {
print('ENAD in model view');
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);
await _productLocationService.getProductAvailabiltyDetail(); await _productLocationService.getProductAvailabiltyDetail();

@ -159,7 +159,7 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
PharmacyPage(), PharmacyPage(),
PharmacyCategorisePage(), PharmacyCategorisePage(),
// OffersCategorisePage(), // OffersCategorisePage(),
WishlistPage(), WishlistPage(false),
PharmacyProfilePage(), PharmacyProfilePage(),
// Container( // Container(
// child: Text('text'), // child: Text('text'),

@ -196,7 +196,9 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications[0].name, text: widget.data[index].specifications != null ?
widget.data[index].specifications[0].name :
"No data",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
@ -211,7 +213,9 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications[1].name, text: widget.data[index].specifications != null ?
widget.data[index].specifications[1].name :
"No data",
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: 15, fontSize: 15,
@ -234,7 +238,9 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications[2].name, text:widget.data[index].specifications != null ?
widget.data[index].specifications[2].name :
"No data",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
@ -249,7 +255,9 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications[3].name, text: widget.data[index].specifications != null ?
widget.data[index].specifications[3].name :
"No data",
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: 15, fontSize: 15,
@ -272,7 +280,9 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications[4].name, text:widget.data[index].specifications != null ?
widget.data[index].specifications[4].name :
"No data",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
@ -287,7 +297,9 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications[5].name, text:widget.data[index].specifications != null ?
widget.data[index].specifications[5].name :
"No data",
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: 15, fontSize: 15,

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/pages/final_products_page.dart';
import 'package:diplomaticquarterapp/pages/login/register-info.dart'; import 'package:diplomaticquarterapp/pages/login/register-info.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/search_brands_page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/search_brands_page.dart';
import 'package:diplomaticquarterapp/pages/search_products_page.dart'; import 'package:diplomaticquarterapp/pages/search_products_page.dart';
@ -61,7 +62,7 @@ class _ProductBrandsPageState extends State<ProductBrandsPage> {
height: 220, height: 220,
width: double.infinity, width: double.infinity,
color: Colors.white, color: Colors.white,
child: topBrand(), child: topBrand(context),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -125,7 +126,11 @@ class _ProductBrandsPageState extends State<ProductBrandsPage> {
), ),
), ),
onTap: (){ onTap: (){
print("ENAD"); Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FinalProductsPage(id: model.brandsListList[index].id.toString(),)),
);
}, },
); );
}), }),
@ -139,7 +144,7 @@ class _ProductBrandsPageState extends State<ProductBrandsPage> {
} }
topBrand() { topBrand(BuildContext context) {
return BaseView<BrandsViewModel>( return BaseView<BrandsViewModel>(
onModelReady: (model) => model.getTopBrandsData(), onModelReady: (model) => model.getTopBrandsData(),
builder: (_, model, wi) => GridView.count( builder: (_, model, wi) => GridView.count(
@ -180,7 +185,11 @@ topBrand() {
), ),
), ),
onTap: (){ onTap: (){
print("ENAD"); Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FinalProductsPage(id: model.topBrandsListList[index].id.toString(),)),
);
}, },
), ),
], ],

File diff suppressed because it is too large Load Diff

@ -5,6 +5,8 @@ import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
class WishlistPage extends StatefulWidget { class WishlistPage extends StatefulWidget {
bool showBar;
WishlistPage(this.showBar);
@override @override
_WishlistPageState createState() => _WishlistPageState(); _WishlistPageState createState() => _WishlistPageState();
} }
@ -17,9 +19,9 @@ class _WishlistPageState extends State<WishlistPage> {
onModelReady: (model) => model.getWishlistData(), onModelReady: (model) => model.getWishlistData(),
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: 'Wishlist page', appBarTitle: 'Wishlist page',
isShowAppBar: false, isShowAppBar: widget.showBar,
isShowDecPage: false, isShowDecPage: false,
isPharmacy: false, isPharmacy: true,
baseViewModel: model, baseViewModel: model,
body: model.wishListList.length == 0 body: model.wishListList.length == 0
? Container( ? Container(

@ -226,7 +226,7 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) =>
WishlistPage())); WishlistPage(true)));
}, },
child: Column( child: Column(
children: <Widget>[ children: <Widget>[

@ -121,7 +121,7 @@ class ProductDetailService extends BaseService {
request = { request = {
"shopping_cart_item": {"quantity": 1, "shopping_cart_type": "Wishlist", "product_id": itemID, "customer_id": customerId, "language_id": 1} "shopping_cart_item": {"quantity": 1, "shopping_cart_type": "Wishlist", "product_id": itemID, "customer_id": customerId, "language_id": 1}
}; };
await baseAppClient.post(GET_SHOPPING_CART, await baseAppClient.pharmacyPost(GET_SHOPPING_CART,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_wishListProducts.clear(); _wishListProducts.clear();
response['shopping_carts'].forEach((item) { response['shopping_carts'].forEach((item) {
@ -172,6 +172,7 @@ class ProductDetailService extends BaseService {
_productSpecification.clear(); _productSpecification.clear();
response['specification'].forEach((item) { response['specification'].forEach((item) {
_productSpecification.add(SpecificationModel.fromJson(item)); _productSpecification.add(SpecificationModel.fromJson(item));
print(_productSpecification);
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -66,8 +66,8 @@ class productTile extends StatelessWidget {
) )
: Container( : Container(
margin: EdgeInsets.only(left: 10), margin: EdgeInsets.only(left: 10),
child: Image.asset( child: Image.network(
"assets/images/no_image.png", productImage,
width: 80, width: 80,
height: 80, height: 80,
) )

Loading…
Cancel
Save