Merge branch 'pharmacy_fix' into 'development'

Pharmacy fix

See merge request Cloud_Solution/diplomatic-quarter!407
merge-update-with-lab-changes
Mohammad Aljammal 5 years ago
commit 361b72624b

@ -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'))
], ],
), ),
)
],
), ),
) )
], ],

@ -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