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-requests/543/head
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_ORDERS = '/api/orders';
const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

@ -41,6 +41,12 @@ class ListClinicCentralized {
data['LiveCareServiceID'] = this.liveCareServiceID;
return data;
}
@override
String toString() {
return '${clinicDescription}'.toLowerCase() + ' ${clinicDescription}'.toUpperCase();
}
}
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/LaserBooking.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/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
@ -40,6 +41,7 @@ class SearchByClinic extends StatefulWidget {
class _SearchByClinicState extends State<SearchByClinic> {
bool nearestAppo = false;
String dropdownValue;
String dropdownTitle = "";
String projectDropdownValue;
// var event = RobotProvider();
@ -101,9 +103,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
top: 20,
),
child: Text(
TranslationBase
.of(context)
.doctorFilter,
TranslationBase.of(context).doctorFilter,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
@ -118,9 +118,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
Padding(
padding: const EdgeInsets.only(left: 20, right: 20),
child: Text(
TranslationBase
.of(context)
.gender,
TranslationBase.of(context).gender,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
@ -135,56 +133,48 @@ class _SearchByClinicState extends State<SearchByClinic> {
children: [
Flexible(
child: Row(
children: [
Radio(
value: TranslationBase
.of(context)
.female,
groupValue: radioValue,
onChanged: (v) {
setState(() {
radioValue = v;
});
},
),
Text(
TranslationBase
.of(context)
.female,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
)),
children: [
Radio(
value: TranslationBase.of(context).female,
groupValue: radioValue,
onChanged: (v) {
setState(() {
radioValue = v;
});
},
),
Text(
TranslationBase.of(context).female,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
)),
Flexible(
child: Row(
children: [
Radio(
value: TranslationBase
.of(context)
.male,
groupValue: radioValue,
onChanged: (v) {
setState(() {
radioValue = v;
});
},
),
Text(
TranslationBase
.of(context)
.male,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
)),
children: [
Radio(
value: TranslationBase.of(context).male,
groupValue: radioValue,
onChanged: (v) {
setState(() {
radioValue = v;
});
},
),
Text(
TranslationBase.of(context).male,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
)),
],
),
),
@ -214,173 +204,143 @@ class _SearchByClinicState extends State<SearchByClinic> {
});
},
),
Text(TranslationBase
.of(context)
.nearestAppo, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56)),
Text(TranslationBase.of(context).nearestAppo, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56)),
],
),
),
widget.clnicIds != null && widget.clnicIds.length > 1 && isLoaded == true
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: clinicsList.map<Widget>((result) {
return RoundedContainer(
child: ListTile(
onTap: () {
// setState(() {
dropdownValue = result.clinicID.toString();
setState(() {
if (!isDentalSelectedAndSupported()) {
projectDropdownValue = "";
getDoctorsList(context);
} else {}
});
},
title: Text(result.clinicDescription, style: TextStyle(fontSize: 14.0, color: Colors.grey[700], letterSpacing: 1.0))));
}).toList())
crossAxisAlignment: CrossAxisAlignment.start,
children: clinicsList.map<Widget>((result) {
return RoundedContainer(
child: ListTile(
onTap: () {
// setState(() {
dropdownValue = result.clinicID.toString();
setState(() {
if (!isDentalSelectedAndSupported()) {
projectDropdownValue = "";
getDoctorsList(context);
} else {}
});
},
title: Text(result.clinicDescription, style: TextStyle(fontSize: 14.0, color: Colors.grey[700], letterSpacing: 1.0))));
}).toList())
: InkWell(
onTap: () {
// dropdownKey.currentState;
openDropdown(clinicDropdownKey);
},
child: Container(
width: double.infinity,
decoration: containerRadius(Colors.white, 12),
margin: EdgeInsets.only(left: 20, right: 20),
padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
child: Row(
children: [
Flexible(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
onTap: () {
showClickListDialog(context, clinicsList, onSelection: (ListClinicCentralized clincs) {
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(
width: double.infinity,
decoration: containerRadius(Colors.white, 12),
margin: EdgeInsets.only(left: 20, right: 20),
padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 8),
child: Row(
children: [
Text(
TranslationBase
.of(context)
.selectClinic,
style: TextStyle(
fontSize: 11,
letterSpacing: -0.44,
fontWeight: FontWeight.w600,
),
),
Container(
height: 18,
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
onTap: () {
print("Clicked");
},
key: clinicDropdownKey,
hint: new Text(
TranslationBase
.of(context)
.selectClinic,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).selectClinic,
style: TextStyle(
fontSize: 11,
letterSpacing: -0.44,
fontWeight: FontWeight.w600,
),
),
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");
}
});
},
),
Padding(
padding: const EdgeInsets.only(top: 4, bottom: 2),
child: Text(
dropdownTitle,
style: TextStyle(
fontSize: 13,
letterSpacing: -0.44,
fontWeight: FontWeight.w600,
),
),
),
],
),
),
Icon(Icons.keyboard_arrow_down),
],
),
),
Icon(Icons.keyboard_arrow_down),
],
),
),
),
),
mHeight(20),
isDentalSelectedAndSupported() == true || (nearestAppo && isProjectLoaded)
? InkWell(
onTap: () {
openDropdown(projectDropdownKey);
},
child: Container(
width: double.infinity,
decoration: containerRadius(Colors.white, 12),
margin: EdgeInsets.only(left: 20, right: 20),
padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
child: Row(
children: [
Flexible(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
onTap: () {
openDropdown(projectDropdownKey);
},
child: Container(
width: double.infinity,
decoration: containerRadius(Colors.white, 12),
margin: EdgeInsets.only(left: 20, right: 20),
padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
child: Row(
children: [
Text(
TranslationBase.of(context).selectHospital,
style: TextStyle(
fontSize: 11,
letterSpacing: -0.44,
fontWeight: FontWeight.w600,
),
),
Container(
height: 18,
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
key: projectDropdownKey,
hint: new Text(TranslationBase.of(context).selectHospital),
value: projectDropdownValue,
iconSize: 0,
isExpanded: true,
style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black),
items: projectsList.map((item) {
return new DropdownMenuItem<String>(
value: item.mainProjectID.toString(),
child: new Text(item.name),
);
}).toList(),
onChanged: (newValue) {
setState(() {
projectDropdownValue = newValue;
getDoctorsList(context);
});
},
),
Flexible(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).selectHospital,
style: TextStyle(
fontSize: 11,
letterSpacing: -0.44,
fontWeight: FontWeight.w600,
),
),
Container(
height: 18,
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
key: projectDropdownKey,
hint: new Text(TranslationBase.of(context).selectHospital),
value: projectDropdownValue,
iconSize: 0,
isExpanded: true,
style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black),
items: projectsList.map((item) {
return new DropdownMenuItem<String>(
value: item.mainProjectID.toString(),
child: new Text(item.name),
);
}).toList(),
onChanged: (newValue) {
setState(() {
projectDropdownValue = newValue;
getDoctorsList(context);
});
},
),
),
),
],
),
),
Icon(Icons.keyboard_arrow_down),
],
),
),
Icon(Icons.keyboard_arrow_down),
],
)),
)
)),
)
: Container(),
],
),
@ -612,7 +572,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
)
.toList();
if (doctorByHospital.length != 0) {

@ -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) {
return AppScaffold(
isShowAppBar: false,
isShowDecPage: false,
body: SafeArea(
child: Container(
decoration: BoxDecoration(color: Colors.grey[700]),

@ -189,9 +189,10 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
model.paymentCheckoutData.shippingOption == null
? ""
: 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",
fit: BoxFit.contain,
width: 100,
),
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/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
@ -291,7 +290,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
previousModel: model,
)
: isAvailability
//&& widget.product.stockAvailability != "Out of stock"
//&& widget.product.stockAvailability != "Out of stock"
? AvailabilityInfo(previousModel: model)
// : isAvailability && widget.product.stockAvailability == "Out of stock"
// ? Container(
@ -303,7 +302,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
// TranslationBase.of(context).noLocationAvailable,
// ),
// )
: Container(),
: Container(),
],
),
),
@ -374,5 +373,4 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
notifyMeWhenAvailable({itemId, customerId, ProductDetailViewModel model}) async {
await model.notifyMe(customerId, itemId);
}
}

@ -76,9 +76,14 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
icon: Icons.shopping_cart,
color: Colors.grey[800],
onPress: () {
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(
// context,
// MaterialPageRoute(builder: (context) => CartOrderPage()),
@ -156,15 +161,15 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
await addToCartFunction(
quantity: quantity,
itemID: itemID,
model: model,
);
model: model);
Navigator.of(context).pop();
}
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).addQuantity
// "you should add quantity"
);
AppToast.showErrorToast(
message: TranslationBase.of(context).addQuantity
// "you should add quantity"
);
}
}),
ListTile(
@ -191,7 +196,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
),
onTap: () {
Provider.of<CompareList>(context, listen: false)
.addItem(specificationData,context);
.addItem(specificationData, context);
Navigator.of(context).pop();
},
),

@ -249,12 +249,10 @@ class _ProductOrderItemState extends State<ProductOrderItem> {
newValue = widget.item.quantity - 1;
}
widget.item.quantity = newValue;
} else
{
_quantityController.text = "${widget.item.quantity}";
_totalPrice =
"${(widget.item.product.price * widget.item.quantity).toStringAsFixed(2)}";
}
_quantityController.text = "${widget.item.quantity}";
_totalPrice =
"${(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/aramex_shipping_logo.png",
fit: BoxFit.contain,
// height: 100,
width: 100,
),
),

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

Loading…
Cancel
Save