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

merge-update-with-lab-changes
Elham Rababh 5 years ago
commit 19cb48e133

@ -108,10 +108,10 @@ class PharmacyProduct {
List<int> manufacturerIds; List<int> manufacturerIds;
List<Reviews> reviews; List<Reviews> reviews;
List<PharmacyImageObject> images; List<PharmacyImageObject> images;
List<String> attributes; List<dynamic> attributes;
List<Specifications> specifications; List<Specifications> specifications;
List<String> associatedProductIds; List<dynamic> associatedProductIds;
List<String> tags; List<dynamic> tags;
int vendorId; int vendorId;
String seName; String seName;
@ -367,7 +367,7 @@ class PharmacyProduct {
}); });
} }
if (json['attributes'] != null) { if (json['attributes'] != null) {
attributes = new List<String>(); attributes = new List<dynamic>();
json['attributes'].forEach((v) { json['attributes'].forEach((v) {
attributes.add(v); attributes.add(v);
}); });

@ -785,7 +785,8 @@ class BaseAppClient {
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
print("statusCode :$statusCode"); print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode); var parsed = json.decode(utf8.decode(response.bodyBytes));
onFailure(parsed['error']['ErrorEndUserMsg'] ??'Error While Fetching data', statusCode);
} else { } else {
// var parsed = json.decode(response.body.toString()); // var parsed = json.decode(response.body.toString());
var parsed = json.decode(utf8.decode(response.bodyBytes)); var parsed = json.decode(utf8.decode(response.bodyBytes));

@ -113,7 +113,6 @@ class PharmacyModuleService extends BaseService {
} }
Future getTopManufacturerList() async { Future getTopManufacturerList() async {
hasError = false;
Map<String, String> queryParams = {'page': '1', 'limit': '8'}; Map<String, String> queryParams = {'page': '1', 'limit': '8'};
try { try {
await baseAppClient.getPharmacy(GET_PHARMACY_TOP_MANUFACTURER, await baseAppClient.getPharmacy(GET_PHARMACY_TOP_MANUFACTURER,
@ -125,6 +124,7 @@ class PharmacyModuleService extends BaseService {
manufacturerList.add(Manufacturer.fromJson(item)); manufacturerList.add(Manufacturer.fromJson(item));
// } // }
}); });
hasError = false;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -146,6 +146,7 @@ class PharmacyModuleService extends BaseService {
response['products'].forEach((item) { response['products'].forEach((item) {
bestSellerProducts.add(PharmacyProduct.fromJson(item)); bestSellerProducts.add(PharmacyProduct.fromJson(item));
}); });
hasError = false;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -161,6 +162,7 @@ class PharmacyModuleService extends BaseService {
null) { null) {
lastVisited = lastVisited =
await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS); await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS);
// lastVisited = "2458,4561";
try { try {
await baseAppClient await baseAppClient
.getPharmacy("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited", .getPharmacy("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited",
@ -169,8 +171,9 @@ class PharmacyModuleService extends BaseService {
response['products'].forEach((item) { response['products'].forEach((item) {
lastVisitedProducts.add(PharmacyProduct.fromJson(item)); lastVisitedProducts.add(PharmacyProduct.fromJson(item));
}); });
hasError = false;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true; // sharedPref.setString(PHARMACY_LAST_VISITED_PRODUCTS, "");
super.error = error; super.error = error;
}); });
} catch (error) { } catch (error) {

@ -13,7 +13,7 @@ class LastVisitedViewModel extends BaseViewModel {
_pharmacyService.lastVisitedProducts; _pharmacyService.lastVisitedProducts;
getLastVisitedProducts() async { getLastVisitedProducts() async {
setState(ViewState.Busy); setState(ViewState.BusyLocal);
await _pharmacyService.getLastVisitedProducts(); await _pharmacyService.getLastVisitedProducts();
if (_pharmacyService.hasError) { if (_pharmacyService.hasError) {
error = _pharmacyService.error; error = _pharmacyService.error;

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

@ -48,10 +48,8 @@ class _PharmacyPageState extends State<PharmacyPage> {
return BaseView<PharmacyModuleViewModel>( return BaseView<PharmacyModuleViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
// GifLoaderDialogUtils.showMyDialog(context);
await model.getSavedLanguage(); await model.getSavedLanguage();
await model.getBannerList(); await model.getBannerList();
// GifLoaderDialogUtils.hideDialog(context);
}, },
allowAny: true, allowAny: true,
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(

@ -24,6 +24,7 @@ class ProductTileItem extends StatelessWidget {
void _saveLastVisitProducts() async { void _saveLastVisitProducts() async {
String lastVisited = ""; String lastVisited = "";
bool isIdExist = false; bool isIdExist = false;
List items = [];
if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) != if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) !=
null) { null) {
lastVisited = lastVisited =
@ -32,8 +33,27 @@ class ProductTileItem extends StatelessWidget {
if (id == item.id) { if (id == item.id) {
isIdExist = true; isIdExist = true;
} }
items.add(id);
}); });
} }
if(items.length >= 15){
items.removeAt(0);
// lastVisited = lastVisited.replaceFirst(RegExp('$itemToRemove'), '');
}
lastVisited = "";
for(int i = items.length - 1; i >= 0; i--){
if (lastVisited == "") {
// it means there is no lastVisited yet
lastVisited = "${items[i]}";
} else {
// there is lastVisited id's and this product id is not found
lastVisited += ",${items[i]}";
}
}
if (!isIdExist) { if (!isIdExist) {
if (lastVisited == "") { if (lastVisited == "") {
// it means there is no lastVisited yet // it means there is no lastVisited yet
@ -42,8 +62,8 @@ class ProductTileItem extends StatelessWidget {
// there is lastVisited id's and this product id is not found // there is lastVisited id's and this product id is not found
lastVisited += ",${item.id}"; lastVisited += ",${item.id}";
} }
sharedPref.setString(PHARMACY_LAST_VISITED_PRODUCTS, lastVisited);
} }
sharedPref.setString(PHARMACY_LAST_VISITED_PRODUCTS, lastVisited);
} }
@override @override

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

@ -14,7 +14,7 @@ class ViewAllHomeWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
margin: EdgeInsets.fromLTRB(10, 10, 10, 10), margin: EdgeInsets.fromLTRB(16, 10, 16, 10),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -28,7 +28,7 @@ class ViewAllHomeWidget extends StatelessWidget {
borderColor: Colors.green, borderColor: Colors.green,
textColor: Colors.green, textColor: Colors.green,
vPadding: 6, vPadding: 6,
hPadding: 4, hPadding: 8,
handler: () { handler: () {
Navigator.push( Navigator.push(
context, context,

@ -19,7 +19,10 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/pharmacy/my_account_items.dart';
import 'package:diplomaticquarterapp/widgets/pharmacy/my_account_services.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';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
@ -108,7 +111,10 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
Container( Container(
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Container( Padding(
padding: EdgeInsets.symmetric(
horizontal: 15.0, vertical: 8.0),
child: Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 20.0, top: 20.0,
left: 10.0, left: 10.0,
@ -116,36 +122,42 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
bottom: 10.0, bottom: 10.0,
), ),
child: LargeAvatar( child: LargeAvatar(
radius: 55.0,
name: user.firstName.toString(), name: user.firstName.toString(),
url: '', url:
'https://thumbs.dreamstime.com/b/default-avatar-profile-vector-user-profile-default-avatar-profile-vector-user-profile-profile-179376714.jpg',
),
), ),
), ),
Column(children: <Widget>[ Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Row(children: <Widget>[ Row(children: <Widget>[
Text( Texts(
TranslationBase.of(context) TranslationBase.of(context)
.welcome, .welcome,
style: TextStyle( fontSize: 16.0,
fontSize: 14.0,
fontWeight: FontWeight.bold,
color: Colors.grey),
), ),
]), ]),
SizedBox( SizedBox(
height: 10, height: 5.0,
), ),
Row(children: <Widget>[ Row(children: <Widget>[
Text( Texts(
languageID == "ar" languageID == "ar"
? user.firstNameN.toString() + ? user.firstNameN
.toString() +
" " + " " +
user.lastNameN.toString() user.lastNameN
: user.firstName.toString() + .toString()
: user.firstName
.toString() +
" " + " " +
user.lastName.toString(), user.lastName
style: TextStyle( .toString(),
fontSize: 14.0, fontSize: 17.0,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold,
), ),
]), ]),
]), ]),
@ -168,8 +180,10 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
Container( Container(
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( AccountServices(
child: InkWell( title: TranslationBase.of(context).orders,
serviceImage:
'assets/images/pharmacy/orders_icon.svg',
onTap: () { onTap: () {
if (customerId == null) { if (customerId == null) {
AppToast.showErrorToast( AppToast.showErrorToast(
@ -182,56 +196,20 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
page: OrderPage( page: OrderPage(
customerID: customerId))); customerID: customerId)));
}, },
child: Column(
children: <Widget>[
// Image(image: AssetImage('assets/images/pharmacy/orders_icon.svg')),
SvgPicture.asset(
'assets/images/pharmacy/orders_icon.svg',
width: 50,
height: 50,
),
SizedBox(
height: 5,
),
Text(
TranslationBase.of(context).orders,
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold,
),
),
],
),
), ),
), AccountServices(
Expanded( title: TranslationBase.of(context).lakum,
child: InkWell( serviceImage:
'assets/images/pharmacy/lakum_icon.svg',
onTap: () { onTap: () {
Navigator.push(context, Navigator.push(context,
FadePage(page: LakumMainPage())); FadePage(page: LakumMainPage()));
}, },
child: Column(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/lakum_icon.svg',
width: 50,
height: 50,
),
SizedBox(
height: 5,
),
Text(
TranslationBase.of(context).lakum,
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold),
), ),
], AccountServices(
), title: TranslationBase.of(context).wishlist,
), serviceImage:
), 'assets/images/pharmacy/wishlist_icon.svg',
Expanded(
child: InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
@ -239,54 +217,16 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
builder: (context) => builder: (context) =>
WishlistPage(true))); WishlistPage(true)));
}, },
child: Column(
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/wishlist_icon.svg',
width: 50,
height: 50,
), ),
SizedBox( AccountServices(
height: 5, title: TranslationBase.of(context).reviews,
), serviceImage:
Text( 'assets/images/pharmacy/review_icon.svg',
TranslationBase.of(context).wishlist,
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold,
),
),
],
),
),
),
Expanded(
child: InkWell(
onTap: () { onTap: () {
Navigator.push(context, Navigator.push(context,
FadePage(page: MyReviewsPage())); FadePage(page: MyReviewsPage()));
}, },
child: Column( )
children: <Widget>[
SvgPicture.asset(
'assets/images/pharmacy/review_icon.svg',
width: 50,
height: 50,
),
SizedBox(
height: 5,
),
Text(
TranslationBase.of(context).reviews,
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold,
),
),
],
),
),
),
], ],
)), )),
SizedBox( SizedBox(
@ -303,16 +243,13 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
height: 10, height: 10,
), ),
Container( Container(
padding: EdgeInsets.only(left: 10.0), padding: EdgeInsets.symmetric(horizontal: 25.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Texts(TranslationBase.of(context).myAccount,
TranslationBase.of(context).myAccount,
style: TextStyle(
fontSize: 16.0, fontSize: 16.0,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -327,24 +264,11 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
FadePage( FadePage(
page: HomePrescriptionsPage())); page: HomePrescriptionsPage()));
}, },
child: Row( child: AccountItem(
children: <Widget>[ title: TranslationBase.of(context)
SvgPicture.asset(
'assets/images/pharmacy/my_prescription_icon.svg',
width: 28,
height: 28,
),
SizedBox(
width: 15,
),
Text(
TranslationBase.of(context)
.myPrescription, .myPrescription,
style: TextStyle( itemIcon:
fontSize: 13.0, 'assets/images/pharmacy/my_prescription_icon.svg',
),
),
],
), ),
), ),
SizedBox( SizedBox(
@ -359,24 +283,12 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
Navigator.push(context, Navigator.push(context,
FadePage(page: ComparePage())); FadePage(page: ComparePage()));
}, },
child: Row( child: AccountItem(
children: <Widget>[ isTerms: true,
Image.asset( title: TranslationBase.of(context)
'assets/images/pharmacy/compare.png', .compare,
width: 35, itemIcon:
height: 35), "assets/images/pharmacy/compare.png")),
SizedBox(
width: 15,
),
Text(
TranslationBase.of(context).compare,
style: TextStyle(
fontSize: 13.0,
),
),
],
),
),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
@ -391,25 +303,11 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
FadePage( FadePage(
page: HomePrescriptionsPage())); page: HomePrescriptionsPage()));
}, },
child: Row( child: AccountItem(
children: <Widget>[ title: TranslationBase.of(context)
SvgPicture.asset(
'assets/images/pharmacy/medication_refill_icon.svg',
width: 30,
height: 30,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context)
.medicationsRefill, .medicationsRefill,
style: TextStyle( itemIcon:
fontSize: 13.0, 'assets/images/pharmacy/medication_refill_icon.svg'),
),
),
],
),
), ),
SizedBox( SizedBox(
height: 5, height: 5,
@ -423,23 +321,10 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
Navigator.push( Navigator.push(
context, FadePage(page: MyFamily())); context, FadePage(page: MyFamily()));
}, },
child: Row( child: AccountItem(
children: <Widget>[ title: TranslationBase.of(context).family,
SvgPicture.asset( itemIcon:
'assets/images/pharmacy/my_family_icon.svg', 'assets/images/pharmacy/my_family_icon.svg',
width: 20,
height: 20,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context).family,
style: TextStyle(
fontSize: 13.0,
),
),
],
), ),
), ),
SizedBox( SizedBox(
@ -456,24 +341,11 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
FadePage( FadePage(
page: PharmacyAddressesPage())); page: PharmacyAddressesPage()));
}, },
child: Row( child: AccountItem(
children: <Widget>[ itemIcon:
SvgPicture.asset(
'assets/images/pharmacy/shipping_addresses_icon.svg', 'assets/images/pharmacy/shipping_addresses_icon.svg',
width: 30, title: TranslationBase.of(context)
height: 30,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context)
.shippingAddresses, .shippingAddresses,
style: TextStyle(
fontSize: 13.0,
),
),
],
), ),
), ),
SizedBox( SizedBox(
@ -488,28 +360,15 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: PharmacyTermsConditions())); page:
PharmacyTermsConditions()));
}, },
child: Row( child: AccountItem(
children: <Widget>[ isTerms: true,
Image.asset( title: TranslationBase.of(context)
'assets/images/pharmacy/terms.png',
width: 25,
height: 25,
),
SizedBox(
width: 10,
),
Text(
TranslationBase.of(context)
.conditionsHMG, .conditionsHMG,
style: TextStyle( itemIcon:
fontSize: 13.0, 'assets/images/pharmacy/terms.png')),
),
),
],
),
),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
@ -529,28 +388,13 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
this.mobileNo, this.mobileNo,
this.languageId))); this.languageId)));
}, },
child: Row( child: AccountItem(
children: <Widget>[ title: TranslationBase.of(context)
Image.asset(
'assets/images/pharmacy/terms.png',
width: 25,
height: 25,
),
// IconButton(icon: Icon(Icons.error_outline), iconSize: 30,
// color: Colors.black,),
SizedBox(
width: 10,
),
Text(
TranslationBase.of(context)
.conditions, .conditions,
style: TextStyle( itemIcon:
fontSize: 13.0, 'assets/images/pharmacy/terms.png',
), isTerms: true,
), )),
],
),
),
], ],
), ),
), ),
@ -567,17 +411,17 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( Padding(
padding: const EdgeInsets.symmetric(
horizontal: 15.0, vertical: 8.0),
child: Container(
padding: EdgeInsets.only(left: 10.0), padding: EdgeInsets.only(left: 10.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Texts(TranslationBase.of(context).reachUs,
TranslationBase.of(context).reachUs,
style: TextStyle(
fontSize: 16.0, fontSize: 16.0,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
@ -590,22 +434,11 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
Navigator.push(context, Navigator.push(context,
FadePage(page: LiveChatPage())); FadePage(page: LiveChatPage()));
}, },
child: Row( child: AccountItem(
children: <Widget>[ title: TranslationBase.of(context)
SvgPicture.asset( .contactUs,
'assets/images/pharmacy/contact_us_icon.svg', itemIcon:
width: 20, 'assets/images/pharmacy/contact_us_icon.svg'),
height: 20,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context).contactUs,
style: TextStyle(fontSize: 13.0),
),
],
),
), ),
SizedBox( SizedBox(
height: 5, height: 5,
@ -619,25 +452,13 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
Navigator.push(context, Navigator.push(context,
FadePage(page: FindUsPage())); FadePage(page: FindUsPage()));
}, },
child: Row( child: AccountItem(
children: <Widget>[ title: TranslationBase.of(context)
SvgPicture.asset(
'assets/images/pharmacy/our_locations_icon.svg',
width: 30,
height: 30,
),
SizedBox(
width: 20,
),
Text(
TranslationBase.of(context)
.ourLocations, .ourLocations,
style: TextStyle(fontSize: 13.0), itemIcon:
), 'assets/images/pharmacy/our_locations_icon.svg'))
], ],
), ),
)
],
), ),
) )
], ],

@ -98,7 +98,7 @@ class ProductDetailService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
AppToast.showErrorToast(message: 'something went wrong please try again'); AppToast.showErrorToast(message: super.error??'something went wrong please try again');
}, body: request); }, body: request);
} }

@ -0,0 +1,50 @@
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_svg/flutter_svg.dart';
class AccountItem extends StatelessWidget {
final String title;
final String itemIcon;
final bool isTerms;
const AccountItem({this.title, this.itemIcon, this.isTerms = false});
@override
Widget build(BuildContext context) {
return Row(
children: <Widget>[
isTerms == false
? Container(
height: 35.0,
width: 35.0,
child: SvgPicture.asset(
'$itemIcon',
width: 35,
height: 35,
),
)
: Container(
height: 35.0,
width: 35.0,
child: Image.asset(
'$itemIcon',
width: 35,
height: 35,
),
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
width: 20,
),
Texts(
title,
fontSize: 15.0,
),
],
)
],
);
}
}

@ -0,0 +1,52 @@
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class AccountServices extends StatelessWidget {
final String title;
final String serviceImage;
final Function onTap;
const AccountServices({this.title, this.onTap, this.serviceImage});
@override
Widget build(BuildContext context) {
return Expanded(
child: InkWell(
onTap: onTap,
// () {
// if (customerId == null) {
// AppToast.showErrorToast(
// message: "Customer not found");
// return;
// }
// Navigator.push(
// context,
// FadePage(
// page: OrderPage(
// customerID: customerId)));
// },
child: Column(
children: <Widget>[
// Image(image: AssetImage('assets/images/pharmacy/orders_icon.svg')),
SvgPicture.asset(
'$serviceImage',
width: 55,
height: 55,
),
SizedBox(
height: 7,
),
Texts(
title,
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
],
),
),
);
}
}
Loading…
Cancel
Save