Merge branch 'development_new_design_2.0' into Fatima-New-Design

# Conflicts:
#	lib/pages/pharmacies/screens/product-details/shared/product_details_app_bar.dart
#	lib/pages/pharmacies/widgets/ProductOrderItem.dart
merge-update-with-lab-changes
Fatimah Alshammari 4 years ago
commit e640f41c35

@ -15,8 +15,8 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

@ -41,6 +41,12 @@ class ListClinicCentralized {
data['LiveCareServiceID'] = this.liveCareServiceID; data['LiveCareServiceID'] = this.liveCareServiceID;
return data; return data;
} }
@override
String toString() {
return '${clinicDescription}'.toLowerCase() + ' ${clinicDescription}'.toUpperCase();
}
} }
class ListGetBookScheduleConfigsList { class ListGetBookScheduleConfigsList {

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/LaserBooking.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/LaserBooking.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/dialog/clinic_list_dialog.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
@ -40,6 +41,7 @@ class SearchByClinic extends StatefulWidget {
class _SearchByClinicState extends State<SearchByClinic> { class _SearchByClinicState extends State<SearchByClinic> {
bool nearestAppo = false; bool nearestAppo = false;
String dropdownValue; String dropdownValue;
String dropdownTitle = "";
String projectDropdownValue; String projectDropdownValue;
// var event = RobotProvider(); // var event = RobotProvider();
@ -101,9 +103,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
top: 20, top: 20,
), ),
child: Text( child: Text(
TranslationBase TranslationBase.of(context).doctorFilter,
.of(context)
.doctorFilter,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -118,9 +118,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
Padding( Padding(
padding: const EdgeInsets.only(left: 20, right: 20), padding: const EdgeInsets.only(left: 20, right: 20),
child: Text( child: Text(
TranslationBase TranslationBase.of(context).gender,
.of(context)
.gender,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -137,9 +135,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
child: Row( child: Row(
children: [ children: [
Radio( Radio(
value: TranslationBase value: TranslationBase.of(context).female,
.of(context)
.female,
groupValue: radioValue, groupValue: radioValue,
onChanged: (v) { onChanged: (v) {
setState(() { setState(() {
@ -148,9 +144,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
}, },
), ),
Text( Text(
TranslationBase TranslationBase.of(context).female,
.of(context)
.female,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -163,9 +157,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
child: Row( child: Row(
children: [ children: [
Radio( Radio(
value: TranslationBase value: TranslationBase.of(context).male,
.of(context)
.male,
groupValue: radioValue, groupValue: radioValue,
onChanged: (v) { onChanged: (v) {
setState(() { setState(() {
@ -174,9 +166,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
}, },
), ),
Text( Text(
TranslationBase TranslationBase.of(context).male,
.of(context)
.male,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -214,9 +204,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
}); });
}, },
), ),
Text(TranslationBase Text(TranslationBase.of(context).nearestAppo, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56)),
.of(context)
.nearestAppo, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56)),
], ],
), ),
), ),
@ -240,79 +228,51 @@ class _SearchByClinicState extends State<SearchByClinic> {
}).toList()) }).toList())
: InkWell( : InkWell(
onTap: () { onTap: () {
// dropdownKey.currentState; showClickListDialog(context, clinicsList, onSelection: (ListClinicCentralized clincs) {
openDropdown(clinicDropdownKey); Navigator.pop(context);
setState(() {
print(clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString());
dropdownTitle = clincs.clinicDescription;
dropdownValue =
clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString();
if (dropdownValue == "253-false-0-0") {
Navigator.push(context, FadePage(page: LaserClinic()));
} else if (!isDentalSelectedAndSupported() && !nearestAppo) {
projectDropdownValue = "";
getDoctorsList(context);
} else {
print("Dental");
}
});
});
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
decoration: containerRadius(Colors.white, 12), decoration: containerRadius(Colors.white, 12),
margin: EdgeInsets.only(left: 20, right: 20), margin: EdgeInsets.only(left: 20, right: 20),
padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 8),
child: Row( child: Row(
children: [ children: [
Flexible( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
TranslationBase TranslationBase.of(context).selectClinic,
.of(context)
.selectClinic,
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: 11,
letterSpacing: -0.44, letterSpacing: -0.44,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
Container( Padding(
height: 18, padding: const EdgeInsets.only(top: 4, bottom: 2),
child: DropdownButtonHideUnderline( child: Text(
child: DropdownButton<String>( dropdownTitle,
onTap: () { style: TextStyle(
print("Clicked"); fontSize: 13,
}, letterSpacing: -0.44,
key: clinicDropdownKey, fontWeight: FontWeight.w600,
hint: new Text(
TranslationBase
.of(context)
.selectClinic,
),
value: dropdownValue,
iconSize: 0,
isExpanded: true,
style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
items: clinicsList.map((item) {
return new DropdownMenuItem<String>(
value: item.clinicID.toString() +
"-" +
item.isLiveCareClinicAndOnline.toString() +
"-" +
item.liveCareClinicID.toString() +
"-" +
item.liveCareServiceID.toString(),
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Text(item.clinicDescription),
item.isLiveCareClinicAndOnline
? SvgPicture.asset('assets/images/new-design/video_icon_green_right.svg', height: 12, width: 12, fit: BoxFit.cover)
: Container(),
]),
);
}).toList(),
onChanged: (newValue) {
setState(() {
print(newValue);
dropdownValue = newValue;
if (dropdownValue == "253-false-0-0") {
Navigator.push(context, FadePage(page: LaserClinic()));
} else
if (!isDentalSelectedAndSupported() && !nearestAppo) {
projectDropdownValue = "";
getDoctorsList(context);
} else {
print("Dental");
}
});
},
), ),
), ),
), ),

@ -0,0 +1,128 @@
import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_svg/svg.dart';
import 'package:progress_hud_v2/generated/i18n.dart';
showClickListDialog(BuildContext context, List<ListClinicCentralized> clinicsList, {Function(ListClinicCentralized) onSelection}) {
showDialog(
context: context,
builder: (BuildContext context) {
return Dialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
), //this right here
child: Container(
width: double.infinity,
// width: MediaQuery.of(context).size.width - 10,
height: MediaQuery.of(context).size.height - 80,
child: ClickListDialog(
clinicsList: clinicsList,
onSelection: onSelection,
),
),
);
},
);
}
class ClickListDialog extends StatefulWidget {
List<ListClinicCentralized> clinicsList;
Function(ListClinicCentralized) onSelection;
ClickListDialog({this.clinicsList, this.onSelection});
@override
_ClickListDialogState createState() => _ClickListDialogState();
}
class _ClickListDialogState extends State<ClickListDialog> {
TextEditingController controller = new TextEditingController();
List<ListClinicCentralized> tempClinicsList = [];
@override
void initState() {
// TODO: implement initState
super.initState();
addAllData();
}
addAllData() {
tempClinicsList.clear();
for (int i = 0; i < widget.clinicsList.length; i++) {
tempClinicsList.add(widget.clinicsList[i]);
}
setState(() {});
}
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: TextField(
controller: controller,
onChanged: (v) {
if (v.length > 0) {
tempClinicsList.clear();
for (int i = 0; i < widget.clinicsList.length; i++) {
if (widget.clinicsList[i].clinicDescription.toLowerCase().contains(v.toLowerCase())) {
tempClinicsList.add(widget.clinicsList[i]);
}
}
} else {
addAllData();
}
setState(() {});
},
decoration: InputDecoration(
hintStyle: TextStyle(fontSize: 17),
hintText: 'Search Clinic',
suffixIcon: Icon(Icons.search),
border: InputBorder.none,
contentPadding: EdgeInsets.all(12),
),
),
),
Expanded(
child: ListView.separated(
padding: EdgeInsets.all(12),
itemBuilder: (context, index) {
return InkWell(
onTap: () {
widget.onSelection(tempClinicsList[index]);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(child: Text(tempClinicsList[index].clinicDescription)),
tempClinicsList[index].isLiveCareClinicAndOnline
? SvgPicture.asset(
'assets/images/new-design/video_icon_green_right.svg',
height: 12,
width: 12,
fit: BoxFit.cover,
)
: Container(),
],
),
),
);
},
itemCount: tempClinicsList.length,
separatorBuilder: (BuildContext context, int index) {
return mHeight(8);
},
),
),
],
),
);
}
}

@ -46,6 +46,7 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
isShowDecPage: false,
body: SafeArea( body: SafeArea(
child: Container( child: Container(
decoration: BoxDecoration(color: Colors.grey[700]), decoration: BoxDecoration(color: Colors.grey[700]),

@ -189,9 +189,10 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
model.paymentCheckoutData.shippingOption == null model.paymentCheckoutData.shippingOption == null
? "" ? ""
: model.paymentCheckoutData.shippingOption.shippingRateComputationMethodSystemName == "Shipping.FixedOrByWeight" : model.paymentCheckoutData.shippingOption.shippingRateComputationMethodSystemName == "Shipping.FixedOrByWeight"
? "assets/images/pharmacy_module/payment/hmg_shipping_logo.png" ? "assets/images/pharmacy_module/payment/LogoParmacyGreen.png"
: "assets/images/pharmacy_module/payment/aramex_shipping_logo.png", : "assets/images/pharmacy_module/payment/aramex_shipping_logo.png",
fit: BoxFit.contain, fit: BoxFit.contain,
width: 100,
), ),
margin: EdgeInsets.symmetric(horizontal: 8), margin: EdgeInsets.symmetric(horizontal: 8),
), ),

@ -1,4 +1,3 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
@ -374,5 +373,4 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
notifyMeWhenAvailable({itemId, customerId, ProductDetailViewModel model}) async { notifyMeWhenAvailable({itemId, customerId, ProductDetailViewModel model}) async {
await model.notifyMe(customerId, itemId); await model.notifyMe(customerId, itemId);
} }
} }

@ -76,9 +76,14 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
icon: Icons.shopping_cart, icon: Icons.shopping_cart,
color: Colors.grey[800], color: Colors.grey[800],
onPress: () { onPress: () {
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
locator<NavigationService>().navigatorKey.currentContext, MaterialPageRoute(builder: (context) => LandingPagePharmacy(currentTab: 3)), (Route<dynamic> r) => false); locator<NavigationService>()
.navigatorKey
.currentContext,
MaterialPageRoute(
builder: (context) =>
LandingPagePharmacy(currentTab: 3)),
(Route<dynamic> r) => false);
// Navigator.push( // Navigator.push(
// context, // context,
// MaterialPageRoute(builder: (context) => CartOrderPage()), // MaterialPageRoute(builder: (context) => CartOrderPage()),
@ -156,13 +161,13 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
await addToCartFunction( await addToCartFunction(
quantity: quantity, quantity: quantity,
itemID: itemID, itemID: itemID,
model: model, model: model);
);
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} else { } else {
AppToast.showErrorToast(message: TranslationBase.of(context).addQuantity AppToast.showErrorToast(
message: TranslationBase.of(context).addQuantity
// "you should add quantity" // "you should add quantity"
); );
} }

@ -249,13 +249,11 @@ class _ProductOrderItemState extends State<ProductOrderItem> {
newValue = widget.item.quantity - 1; newValue = widget.item.quantity - 1;
} }
widget.item.quantity = newValue; widget.item.quantity = newValue;
} else }
{
_quantityController.text = "${widget.item.quantity}"; _quantityController.text = "${widget.item.quantity}";
_totalPrice = _totalPrice =
"${(widget.item.product.price * widget.item.quantity).toStringAsFixed(2)}"; "${(widget.item.product.price * widget.item.quantity).toStringAsFixed(2)}";
} }
}
}); });
} }

@ -254,7 +254,6 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
? "assets/images/pharmacy_module/payment/LogoParmacyGreen.png" ? "assets/images/pharmacy_module/payment/LogoParmacyGreen.png"
: "assets/images/pharmacy_module/payment/aramex_shipping_logo.png", : "assets/images/pharmacy_module/payment/aramex_shipping_logo.png",
fit: BoxFit.contain, fit: BoxFit.contain,
// height: 100,
width: 100, width: 100,
), ),
), ),

@ -172,6 +172,8 @@ dependencies:
badges: ^1.1.4 badges: ^1.1.4
syncfusion_flutter_sliders: ^18.4.49-beta syncfusion_flutter_sliders: ^18.4.49-beta
searchable_dropdown: ^1.1.3
dropdown_search: 0.4.9
# Dep by Zohaib # Dep by Zohaib
shimmer: ^1.1.2 shimmer: ^1.1.2

Loading…
Cancel
Save