fixed issues

enad_pharmacy2
enadhilal 5 years ago
parent 60648d368f
commit 0c6fb67718

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

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

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

@ -196,7 +196,9 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft,
child: RichText(
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(
fontWeight: FontWeight.bold,
color: Colors.black,
@ -211,7 +213,9 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft,
child: RichText(
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(
color: Colors.black54,
fontSize: 15,
@ -234,7 +238,9 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft,
child: RichText(
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(
fontWeight: FontWeight.bold,
color: Colors.black,
@ -249,7 +255,9 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft,
child: RichText(
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(
color: Colors.black54,
fontSize: 15,
@ -272,7 +280,9 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft,
child: RichText(
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(
fontWeight: FontWeight.bold,
color: Colors.black,
@ -287,7 +297,9 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft,
child: RichText(
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(
color: Colors.black54,
fontSize: 15,

@ -1,4 +1,5 @@
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/pharmacies/search_brands_page.dart';
import 'package:diplomaticquarterapp/pages/search_products_page.dart';
@ -61,7 +62,7 @@ class _ProductBrandsPageState extends State<ProductBrandsPage> {
height: 220,
width: double.infinity,
color: Colors.white,
child: topBrand(),
child: topBrand(context),
),
SizedBox(
height: 10,
@ -125,7 +126,11 @@ class _ProductBrandsPageState extends State<ProductBrandsPage> {
),
),
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>(
onModelReady: (model) => model.getTopBrandsData(),
builder: (_, model, wi) => GridView.count(
@ -180,7 +185,11 @@ topBrand() {
),
),
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';
class WishlistPage extends StatefulWidget {
bool showBar;
WishlistPage(this.showBar);
@override
_WishlistPageState createState() => _WishlistPageState();
}
@ -17,9 +19,9 @@ class _WishlistPageState extends State<WishlistPage> {
onModelReady: (model) => model.getWishlistData(),
builder: (_, model, wi) => AppScaffold(
appBarTitle: 'Wishlist page',
isShowAppBar: false,
isShowAppBar: widget.showBar,
isShowDecPage: false,
isPharmacy: false,
isPharmacy: true,
baseViewModel: model,
body: model.wishListList.length == 0
? Container(

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

@ -121,7 +121,7 @@ class ProductDetailService extends BaseService {
request = {
"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) {
_wishListProducts.clear();
response['shopping_carts'].forEach((item) {
@ -172,6 +172,7 @@ class ProductDetailService extends BaseService {
_productSpecification.clear();
response['specification'].forEach((item) {
_productSpecification.add(SpecificationModel.fromJson(item));
print(_productSpecification);
});
}, onFailure: (String error, int statusCode) {
hasError = true;

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

Loading…
Cancel
Save