Merge branch 'development_new_design_2.0' into mirza_home_page

# Conflicts:
#	lib/uitl/translations_delegate_base.dart
merge-requests/499/head
devmirza121 5 years ago
commit 6575456d3b

@ -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/';
@ -26,6 +26,11 @@ const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
// // Pharmacy Pre-Production URLs
// const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/';
// const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/';
// RC API URL // RC API URL
const RC_BASE_URL = 'https://livecare.hmg.com/'; const RC_BASE_URL = 'https://livecare.hmg.com/';

@ -31,6 +31,8 @@ class ProductDetailViewModel extends BaseViewModel {
String get stockAvailability => _productDetailService.stockAvailability; String get stockAvailability => _productDetailService.stockAvailability;
String get stockAvailabilityn => _productDetailService.stockAvailabilityn;
bool get isStockAvailable => _productDetailService.isStockAvailable; bool get isStockAvailable => _productDetailService.isStockAvailable;
Future getProductReviewsData(productID) async { Future getProductReviewsData(productID) async {

@ -25,6 +25,9 @@ class SendActivationRequest {
String dob; String dob;
int isHijri; int isHijri;
String healthId; String healthId;
int responseID;
int status;
SendActivationRequest( SendActivationRequest(
{this.patientMobileNumber, {this.patientMobileNumber,
this.mobileNo, this.mobileNo,
@ -51,7 +54,9 @@ class SendActivationRequest {
this.sMSSignature, this.sMSSignature,
this.dob, this.dob,
this.isHijri, this.isHijri,
this.healthId}); this.healthId,
this.responseID,
this.status});
SendActivationRequest.fromJson(Map<String, dynamic> json) { SendActivationRequest.fromJson(Map<String, dynamic> json) {
patientMobileNumber = json['PatientMobileNumber']; patientMobileNumber = json['PatientMobileNumber'];
@ -80,6 +85,8 @@ class SendActivationRequest {
dob = json['DOB']; dob = json['DOB'];
isHijri = json['IsHijri']; isHijri = json['IsHijri'];
healthId = json['HealthId']; healthId = json['HealthId'];
responseID = json['ReponseID'];
status = json['Status'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -110,6 +117,8 @@ class SendActivationRequest {
data['DOB'] = dob; data['DOB'] = dob;
data['IsHijri'] = isHijri; data['IsHijri'] = isHijri;
data['HealthId'] = healthId; data['HealthId'] = healthId;
data['ResponseID'] = responseID;
data['Status'] = status;
return data; return data;
} }
} }

@ -4,7 +4,6 @@ import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.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/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -23,7 +22,6 @@ class BodyFat extends StatefulWidget {
} }
class _BodyFatState extends State<BodyFat> { class _BodyFatState extends State<BodyFat> {
final GlobalKey clinicDropdownKey = GlobalKey(); final GlobalKey clinicDropdownKey = GlobalKey();
bool _isHeightCM = true; bool _isHeightCM = true;
bool _isNeckKG = true; bool _isNeckKG = true;
@ -34,7 +32,6 @@ class _BodyFatState extends State<BodyFat> {
double _waistValue = 0; double _waistValue = 0;
double _hipValue = 0; double _hipValue = 0;
TextEditingController _heightController = new TextEditingController(); TextEditingController _heightController = new TextEditingController();
TextEditingController _neckController = TextEditingController(); TextEditingController _neckController = TextEditingController();
TextEditingController _waistController = TextEditingController(); TextEditingController _waistController = TextEditingController();
@ -45,12 +42,12 @@ class _BodyFatState extends State<BodyFat> {
List<PopupMenuItem> _waistPopupList = List(); List<PopupMenuItem> _waistPopupList = List();
List<PopupMenuItem> _hipPopupList = List(); List<PopupMenuItem> _hipPopupList = List();
bool isMale = false; bool isMale = false;
// bool isHeightCm = true; // bool isHeightCm = true;
Color maleCard = activeCardColorGender; Color maleCard = activeCardColorGender;
Color femaleCard = inactiveCardColorGender; Color femaleCard = inactiveCardColorGender;
// Color neckCmCard = activeCardColor; // Color neckCmCard = activeCardColor;
// Color neckFtCard = inactiveCardColor; // Color neckFtCard = inactiveCardColor;
Color waistCmCard = activeCardColor; Color waistCmCard = activeCardColor;
@ -59,6 +56,7 @@ class _BodyFatState extends State<BodyFat> {
Color hipFtCard = inactiveCardColor; Color hipFtCard = inactiveCardColor;
Color cmCard = activeCardColor; Color cmCard = activeCardColor;
Color ftCard = inactiveCardColor; Color ftCard = inactiveCardColor;
// int neck = 10; // int neck = 10;
// int heightCm = 0; // int heightCm = 0;
// int heightFt = 0; // int heightFt = 0;
@ -67,6 +65,7 @@ class _BodyFatState extends State<BodyFat> {
double minRange; double minRange;
double maxRange; double maxRange;
double overWeightBy; double overWeightBy;
// int waist = 5; // int waist = 5;
double bodyFat = 0; double bodyFat = 0;
double fat = 0; double fat = 0;
@ -74,8 +73,6 @@ class _BodyFatState extends State<BodyFat> {
double calories = 0; double calories = 0;
String textResult = ''; String textResult = '';
@override @override
void initState() { void initState() {
_neckController.text = _neckValue.toString(); _neckController.text = _neckValue.toString();
@ -105,8 +102,6 @@ class _BodyFatState extends State<BodyFat> {
} }
} }
void updateColorWaist(int type) { void updateColorWaist(int type) {
//MG/DLT card //MG/DLT card
if (type == 1) { if (type == 1) {
@ -199,17 +194,17 @@ class _BodyFatState extends State<BodyFat> {
} }
} else { } else {
if (bodyFat > 5 && fat <= 13) { if (bodyFat > 5 && fat <= 13) {
textResult = 'The category falls under essential'; textResult = TranslationBase.of(context).essential;
} else if (bodyFat > 13 && bodyFat <= 17) { } else if (bodyFat > 13 && bodyFat <= 17) {
textResult = 'The category falls under athlete'; textResult = TranslationBase.of(context).athlete;
} else if (bodyFat > 17 && bodyFat <= 24) { } else if (bodyFat > 17 && bodyFat <= 24) {
textResult = 'The category falls under fitness'; textResult = TranslationBase.of(context).fitness;
} else if (bodyFat > 24 && bodyFat <= 45) { } else if (bodyFat > 24 && bodyFat <= 45) {
textResult = 'The category falls under obese'; textResult = TranslationBase.of(context).underObese;
} else if (bodyFat > 45) { } else if (bodyFat > 45) {
textResult = 'Please check the value you have entered, since the body fat percentage has crosed the limits.'; textResult = TranslationBase.of(context).crossedLimits;
} else if (bodyFat <= 5) { } else if (bodyFat <= 5) {
textResult = 'Please check the value you have entered, since the body fat percentage cannot be this low.'; textResult = TranslationBase.of(context).lowLimits;
} }
} }
} }
@ -247,7 +242,7 @@ class _BodyFatState extends State<BodyFat> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
'Estimates the total body fat based on\nthe size', TranslationBase.of(context).bodyFatDesc,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -395,7 +390,6 @@ class _BodyFatState extends State<BodyFat> {
}, },
_neckPopupList, _neckPopupList,
), ),
SizedBox( SizedBox(
height: 12.0, height: 12.0,
), ),
@ -446,7 +440,6 @@ class _BodyFatState extends State<BodyFat> {
}, },
_hipPopupList, _hipPopupList,
), ),
SizedBox( SizedBox(
height: 12.0, height: 12.0,
), ),
@ -485,6 +478,7 @@ class _BodyFatState extends State<BodyFat> {
), ),
); );
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
@ -691,5 +685,3 @@ class CommonDropDownView extends StatelessWidget {
); );
} }
} }

@ -78,7 +78,8 @@ class DoctorView extends StatelessWidget {
if (doctor.projectName != null) MyRichText(TranslationBase.of(context).branch, doctor.projectName, projectViewModel.isArabic), if (doctor.projectName != null) MyRichText(TranslationBase.of(context).branch, doctor.projectName, projectViewModel.isArabic),
if (doctor.speciality != null) if (doctor.speciality != null)
Text( Text(
getDoctorSpeciality(this.doctor.speciality).trim(), this.doctor.speciality[0].trim(),
// getDoctorSpeciality(this.doctor.speciality).trim(),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12),
), ),
if (doctor.nearestFreeSlot != null) if (doctor.nearestFreeSlot != null)

@ -1,7 +1,6 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/family-file/add_family_file_request.dart'; import 'package:diplomaticquarterapp/core/model/family-file/add_family_file_request.dart';
import 'package:diplomaticquarterapp/core/model/family-file/insert_share_file_request.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
@ -17,7 +16,6 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -41,6 +39,7 @@ class _AddMember extends State<AddMember> {
var familyFileProvider = FamilyFilesProvider(); var familyFileProvider = FamilyFilesProvider();
var patientShareRequestID; var patientShareRequestID;
var patientShareResponseID;
@override @override
void initState() { void initState() {
@ -58,32 +57,22 @@ class _AddMember extends State<AddMember> {
? AppCircularProgressIndicator() ? AppCircularProgressIndicator()
: SingleChildScrollView( : SingleChildScrollView(
child: Container( child: Container(
padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), padding: EdgeInsets.all(21.0),
height: SizeConfig.realScreenHeight * .9, height: SizeConfig.realScreenHeight * .9,
width: SizeConfig.realScreenWidth, width: SizeConfig.realScreenWidth,
child: Column(children: <Widget>[ child: Column(
children: <Widget>[
Expanded( Expanded(
flex: 2, flex: 1,
child: AppText( child: Text(
TranslationBase.of(context).enterNationalId, loginType == 1 ? TranslationBase.of(context).enterNationalId : TranslationBase.of(context).enterFile,
fontSize: SizeConfig.textMultiplier * 3.5, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
textAlign: TextAlign.left,
)), )),
Expanded( Expanded(
flex: 4, flex: 4,
child: Column( child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[ children: <Widget>[
PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value),
//MobileNo(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value),
// Container(
// child: TextFields(
// controller: nationalIDorFile,
// onChanged: (value) => {validateForm()},
// prefixIcon: Icon(loginType == 1 ? Icons.chrome_reader_mode : Icons.receipt, color: Colors.red),
// padding: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10),
// hintText: loginType == 1 ? TranslationBase.of(context).nationalID : TranslationBase.of(context).fileNo,
// ))
SizedBox( SizedBox(
height: 12, height: 12,
), ),
@ -91,26 +80,40 @@ class _AddMember extends State<AddMember> {
], ],
), ),
), ),
Expanded( // Expanded(
flex: 3, // flex: 3,
child: Column( // child: Column(
mainAxisAlignment: MainAxisAlignment.end, // mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ // children: <Widget>[
Row( // Row(
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
// child: DefaultButton(
// TranslationBase.of(context).add,
// () => {this.addMember()},
// color: isButtonDisabled == true ? Colors.grey : CustomColors.accentColor,
// textColor: Colors.white,
// ),
// )
// ],
// ),
// ],
// ),
// )
],
),
),
),
bottomSheet: Container(
color: Colors.white,
padding: EdgeInsets.all(21.0),
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).add, TranslationBase.of(context).add,
() => {this.addMember()}, () => {this.addMember()},
color: isButtonDisabled == true ? Colors.grey : CustomColors.accentColor, color: isButtonDisabled == true ? Colors.grey : CustomColors.accentColor,
textColor: Colors.white, textColor: Colors.white,
)) )),
], );
),
],
))
]),
)));
} }
void validateForm() { void validateForm() {
@ -158,31 +161,30 @@ class _AddMember extends State<AddMember> {
} }
insertFamilyData(addMemberResult) { insertFamilyData(addMemberResult) {
var request = InsertSharePatientFileReq(); sendActivationCode(addMemberResult);
request.responseID = addMemberResult['ShareFamilyFileObj']['ReponseID']; // var request = InsertSharePatientFileReq();
request.shareFamilyPatientName = addMemberResult['ShareFamilyFileObj']['SharedPatientName']; // request.responseID = addMemberResult['ShareFamilyFileObj']['ReponseID'];
request.status = 2; // request.shareFamilyPatientName = addMemberResult['ShareFamilyFileObj']['SharedPatientName'];
if (request.patientOutSA == 1) { // request.status = 2;
request.regionID = 2; // if (request.patientOutSA == 1) {
} else { // request.regionID = 2;
request.regionID = 1; // } else {
} // request.regionID = 1;
loading(true); // }
familyFileProvider.insertNewMember(request).then((value) => sendActivationCode(value)).catchError((err){ // loading(true);
loading(false); // familyFileProvider.insertNewMember(request).then((value) => sendActivationCode(value)).catchError((err) {
AppToast.showErrorToast(message: err); // loading(false);
}); // AppToast.showErrorToast(message: err);
// });
} }
sendActivationCode(result) { sendActivationCode(result) {
// var request = this.getCommonRequest(); // var request = this.getCommonRequest();
loading(true); loading(true);
patientShareRequestID = result['PatientShareRequestID']; patientShareResponseID = result['ShareFamilyFileObj']['ReponseID'];
familyFileProvider.sendActivationCode(mobileNo, countryCode, nationalIDorFile.text).then((result) => { familyFileProvider.sendActivationCode(mobileNo, countryCode, nationalIDorFile.text, patientShareResponseID).then((res) => {
if (result != null && result['isSMSSent'] == true) {this.startSMSService(1, result)} patientShareRequestID = res['PatientShareRequestID'],
// {loading(false), this.startSMSService(type)} if (res != null && res['isSMSSent'] == true) {this.startSMSService(1, res)}
// else
// {loading(false)}
}); });
} }
@ -207,7 +209,7 @@ class _AddMember extends State<AddMember> {
checkActivationCode(value, result) { checkActivationCode(value, result) {
Navigator.pop(context); Navigator.pop(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
familyFileProvider.checkActivationCode(result['LogInTokenID'], value, nationalIDorFile.text, mobileNo).then((result) { familyFileProvider.checkActivationCode(result['LogInTokenID'], value, nationalIDorFile.text, mobileNo, patientShareRequestID, patientShareResponseID).then((result) {
SMSOTP.hideSMSBox(context); SMSOTP.hideSMSBox(context);
handleFamilyRequests(this.patientShareRequestID, 3); handleFamilyRequests(this.patientShareRequestID, 3);
}).catchError((err) { }).catchError((err) {
@ -219,12 +221,12 @@ class _AddMember extends State<AddMember> {
} }
handleFamilyRequests(id, stauts) { handleFamilyRequests(id, stauts) {
familyFileProvider.acceptAndRejectRecievedRequests(id, stauts).then((result) => { // familyFileProvider.acceptAndRejectRecievedRequests(id, stauts).then((result) => {
sharedPref.remove(FAMILY_FILE), sharedPref.remove(FAMILY_FILE);
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
MY_FAMILIY, MY_FAMILIY,
) );
}); // });
} }
loading(flag) { loading(flag) {

@ -26,11 +26,11 @@ class AddFamilyMemberType extends StatelessWidget {
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
children: [ children: [
SizedBox(height: 12), SizedBox(height: 21),
HabibLogoWidget(), HabibLogoWidget(),
SizedBox(height: 50), SizedBox(height: 21),
Text( Text(
TranslationBase.of(context).logintypeRadio, TranslationBase.of(context).registerInfoFamily,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
), ),
GridView( GridView(

@ -27,7 +27,6 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
@ -159,7 +158,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
if (snapshot.hasError) if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
else else
return ListView.separated( return checkActive(snapshot.data.getAllSharedRecordsByStatusList) > 0
? ListView.separated(
itemBuilder: (context, index) { itemBuilder: (context, index) {
if (snapshot.data.getAllSharedRecordsByStatusList[index].status == 3) if (snapshot.data.getAllSharedRecordsByStatusList[index].status == 3)
return Container( return Container(
@ -259,13 +259,14 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
), ),
], ],
))); )));
else if (checkActive(snapshot.data.getAllSharedRecordsByStatusList) == 0) // else if (checkActive(snapshot.data.getAllSharedRecordsByStatusList) == 0)
return getNoDataWidget(context); // return getNoDataWidget(context);
else else
return SizedBox(height: 0); return SizedBox(height: 0);
}, },
separatorBuilder: (context, index) => SizedBox(height: 0), separatorBuilder: (context, index) => SizedBox(height: 0),
itemCount: snapshot.data.getAllSharedRecordsByStatusList.length); itemCount: snapshot.data.getAllSharedRecordsByStatusList.length)
: getNoDataWidget(context);
} }
}, },
), ),
@ -379,87 +380,9 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
itemCount: 1); itemCount: 1);
} }
}, },
))), ),
),
// RoundedContainer( ),
// child: ExpansionTile(
// title: Text(
// TranslationBase.of(context).userViewRequest,
// style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black),
// ),
// children: <Widget>[
// FutureBuilder(
// future: getUserViewRequest(), // async work
// builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
// switch (snapshot.connectionState) {
// case ConnectionState.waiting:
// return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....'));
// default:
// if (snapshot.hasError)
// return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
// else
// return Container(
// padding: EdgeInsets.all(15),
// child: Card(
// elevation: 3,
// shape: cardRadius(8),
// child: Column(
// children: [
// Column(children: [
// Padding(
// padding: EdgeInsets.all(10),
// child: Row(children: [
// Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)),
// Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)),
// Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)),
// ])),
// Divider(color: Colors.black, height: 1.5, thickness: 1.5),
// Column(
// children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
// return Container(
// padding: EdgeInsets.all(10),
// child: Row(
// children: <Widget>[
// Expanded(
// flex: 3,
// child: Texts(
// result.patientName,
// fontWeight: FontWeight.w600,
// fontSize: 12,
// )),
// Expanded(
// flex: 1,
// child: IconButton(
// icon: Icon(
// Icons.check_circle,
// color: Color(0xff349745),
// ),
// onPressed: () {
// acceptRemoveRequest(result.iD, 3, context);
// },
// )),
// Expanded(
// flex: 1,
// child: IconButton(
// icon: Icon(
// Icons.close,
// color: Colors.red[900],
// ),
// onPressed: () {
// acceptRemoveRequest(result.iD, 4, context);
// },
// ))
// ],
// ));
// }).toList())
// ])
// ],
// )));
// }
// })
// ],
// ),
// ),
SizedBox(height: 15), SizedBox(height: 15),
FractionallySizedBox( FractionallySizedBox(
widthFactor: 1.0, widthFactor: 1.0,
@ -528,11 +451,14 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
child: Padding( child: Padding(
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: AppText( child: AppText(
result.statusDescription, result.statusDescription != null ? result.statusDescription : "",
color: Colors.white, color: Colors.white,
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontSize: 12, fontSize: 12,
)))), ),
),
),
),
], ],
)); ));
}).toList(), }).toList(),

@ -241,14 +241,14 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
pageController = PageController(keepPage: true); pageController = PageController(keepPage: true);
_firebaseMessaging.setAutoInitEnabled(true); _firebaseMessaging.setAutoInitEnabled(true);
signalRUtil = new SignalRUtil(hubName: "https://VCallApi.hmg.com/WebRTCHub?source=mobile&username=2001273", context: context); // signalRUtil = new SignalRUtil(hubName: "https://VCallApi.hmg.com/WebRTCHub?source=mobile&username=2001273", context: context);
locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context); locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (projectViewModel.isLogin && !projectViewModel.isLoginChild) { if (projectViewModel.isLogin && !projectViewModel.isLoginChild) {
familyFileProvider.getSharedRecordByStatus(); familyFileProvider.getSharedRecordByStatus();
} }
if (!signalRUtil.getConnectionState()) signalRUtil.startSignalRConnection(); // if (!signalRUtil.getConnectionState()) signalRUtil.startSignalRConnection();
}); });
// HMG (Guest/Internet) Wifi Access [Zohaib Kambrani] // HMG (Guest/Internet) Wifi Access [Zohaib Kambrani]
//for now commented to reduce this call will enable it when needed //for now commented to reduce this call will enable it when needed

@ -1,6 +1,8 @@
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/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-name-and-price.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-name-and-price.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/recommended_products.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/recommended_products.dart';
@ -11,7 +13,9 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.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/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'availability_info.dart'; import 'availability_info.dart';
import 'details_info.dart'; import 'details_info.dart';
@ -85,10 +89,11 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
} }
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<ProductDetailViewModel>( return BaseView<ProductDetailViewModel>(
allowAny: true, allowAny: true,
onModelReady: (model) { onModelReady: (model) async {
model.getProductReviewsData(widget.product.id); await model.getProductReviewsData(widget.product.id).then((value) {});
}, },
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).productDetails, appBarTitle: TranslationBase.of(context).productDetails,
@ -108,7 +113,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
isInWishList: isInWishList, isInWishList: isInWishList,
addToCartFunction: addToCartFunction, addToCartFunction: addToCartFunction,
), ),
body: SingleChildScrollView( body: model.state == ViewState.Idle
? SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
Container( Container(
@ -150,6 +156,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
}, },
isInWishList: isInWishList, isInWishList: isInWishList,
isStockAvailable: model.isStockAvailable, isStockAvailable: model.isStockAvailable,
stockAvailability: projectViewModel.isArabic ? model.stockAvailabilityn : model.stockAvailability,
), ),
), ),
SizedBox( SizedBox(
@ -304,8 +311,10 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
) )
], ],
), ),
), )
bottomSheet: FooterWidget( : AppCircularProgressIndicator(),
bottomSheet: model.state == ViewState.Idle
? FooterWidget(
model.isStockAvailable, model.isStockAvailable,
widget.product.orderMaximumQuantity, widget.product.orderMaximumQuantity,
widget.product.orderMinimumQuantity, widget.product.orderMinimumQuantity,
@ -316,7 +325,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
addToCartFunction: addToCartFunction, addToCartFunction: addToCartFunction,
addToShoppingCartFunction: addToShoppingCartFunction, addToShoppingCartFunction: addToShoppingCartFunction,
model: model, model: model,
), )
: SizedBox(),
)); ));
} }

@ -20,11 +20,12 @@ class ProductNameAndPrice extends StatefulWidget {
final Function addToWishlistFunction; final Function addToWishlistFunction;
final Function deleteFromWishlistFunction; final Function deleteFromWishlistFunction;
final bool isStockAvailable; final bool isStockAvailable;
final String stockAvailability;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
ProductNameAndPrice(this.context, this.item, ProductNameAndPrice(this.context, this.item,
{this.customerId, this.isInWishList, this.notifyMeWhenAvailable, this.addToWishlistFunction, this.deleteFromWishlistFunction, @required this.isStockAvailable}); {this.customerId, this.isInWishList, this.notifyMeWhenAvailable, this.addToWishlistFunction, this.deleteFromWishlistFunction, this.isStockAvailable, this.stockAvailability});
@override @override
_ProductNameAndPriceState createState() => _ProductNameAndPriceState(); _ProductNameAndPriceState createState() => _ProductNameAndPriceState();
@ -48,7 +49,7 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
children: [ children: [
Texts(widget.item.price.toString() + " " + TranslationBase.of(context).sar, fontWeight: FontWeight.bold, fontSize: 20), Texts(widget.item.price.toString() + " " + TranslationBase.of(context).sar, fontWeight: FontWeight.bold, fontSize: 20),
Texts( Texts(
projectViewModel.isArabic ? widget.item.stockAvailabilityn : widget.item.stockAvailability, widget.stockAvailability,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 15, fontSize: 15,
color: widget.isStockAvailable ? Colors.green : Colors.red, color: widget.isStockAvailable ? Colors.green : Colors.red,

@ -140,7 +140,7 @@ class FamilyFilesProvider with ChangeNotifier {
} }
} }
Future<dynamic> sendActivationCode(cellNumber, zipCode, patientIdentificationID) async { Future<dynamic> sendActivationCode(cellNumber, zipCode, patientIdentificationID, responseID) async {
try { try {
dynamic localRes; dynamic localRes;
var request = SendActivationRequest(); var request = SendActivationRequest();
@ -151,6 +151,8 @@ class FamilyFilesProvider with ChangeNotifier {
request.loginType = request.searchType = 1; request.loginType = request.searchType = 1;
request.oTPSendType = 1; request.oTPSendType = 1;
request.isRegister = false; request.isRegister = false;
request.responseID = responseID;
request.status = 2;
await new BaseAppClient().post(SEND_FAMILY_FILE_ACTIVATION, onSuccess: (dynamic response, int statusCode) { await new BaseAppClient().post(SEND_FAMILY_FILE_ACTIVATION, onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -166,7 +168,7 @@ class FamilyFilesProvider with ChangeNotifier {
} }
//TODO //TODO
Future<dynamic> checkActivationCode(loginTokenID, activationCode, indentification, mobileNo) async { Future<dynamic> checkActivationCode(loginTokenID, activationCode, indentification, mobileNo, requestID, responseID) async {
try { try {
dynamic localRes; dynamic localRes;
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
@ -175,6 +177,10 @@ class FamilyFilesProvider with ChangeNotifier {
request['PatientIdentificationID'] = indentification; request['PatientIdentificationID'] = indentification;
request['LogInTokenID'] = loginTokenID; request['LogInTokenID'] = loginTokenID;
request['activationCode'] = activationCode; request['activationCode'] = activationCode;
request['PatientShareRequestID'] = requestID;
request['ResponseID'] = responseID;
request['Status'] = 3;
// this.authService.authenticateRequest(request); // this.authService.authenticateRequest(request);
await new BaseAppClient().post(CHECK_ACTIVATION_CODE, onSuccess: (dynamic response, int statusCode) { await new BaseAppClient().post(CHECK_ACTIVATION_CODE, onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;

@ -2,15 +2,11 @@ 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/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart'; import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart';
import 'package:diplomaticquarterapp/models/pharmacy/addToCartModel.dart';
import 'package:diplomaticquarterapp/models/pharmacy/locationModel.dart'; import 'package:diplomaticquarterapp/models/pharmacy/locationModel.dart';
import 'package:diplomaticquarterapp/models/pharmacy/productDetailModel.dart'; import 'package:diplomaticquarterapp/models/pharmacy/productDetailModel.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/models/pharmacy/specification.dart'; import 'package:diplomaticquarterapp/models/pharmacy/specification.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCart.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class ProductDetailService extends BaseService { class ProductDetailService extends BaseService {
bool isLogin = false; bool isLogin = false;
@ -20,8 +16,10 @@ class ProductDetailService extends BaseService {
num get stockQuantity => _stockQuantity; num get stockQuantity => _stockQuantity;
String _stockAvailability; String _stockAvailability;
String _stockAvailabilityn;
String get stockAvailability => _stockAvailability; String get stockAvailability => _stockAvailability;
String get stockAvailabilityn => _stockAvailabilityn;
bool _isStockAvailable; bool _isStockAvailable;
@ -49,7 +47,7 @@ class ProductDetailService extends BaseService {
Future getProductReviews(productID) async { Future getProductReviews(productID) async {
hasError = false; hasError = false;
await baseAppClient.getPharmacy(GET_PRODUCT_DETAIL + productID + "?fields=reviews,stock_quantity,stock_availability,IsStockAvailable", onSuccess: (dynamic response, int statusCode) { await baseAppClient.getPharmacy(GET_PRODUCT_DETAIL + productID + "?fields=reviews,stock_quantity,stock_availability,stock_availabilityn,IsStockAvailable", onSuccess: (dynamic response, int statusCode) {
_productDetailList.clear(); _productDetailList.clear();
response['products'].forEach((item) { response['products'].forEach((item) {
_productDetailList.add(ProductDetail.fromJson(item)); _productDetailList.add(ProductDetail.fromJson(item));
@ -57,7 +55,10 @@ class ProductDetailService extends BaseService {
}); });
_stockQuantity = response['products'][0]['stock_quantity']; _stockQuantity = response['products'][0]['stock_quantity'];
_stockAvailability = response['products'][0]['stock_availability']; _stockAvailability = response['products'][0]['stock_availability'];
_isStockAvailable = response['products'][0]['IsStockAvailable']; _stockAvailabilityn = response['products'][0]['stock_availabilityn'];
// _isStockAvailable = response['products'][0]['IsStockAvailable'];
_isStockAvailable = _stockAvailability == "In stock" ? true : false;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -2692,39 +2692,61 @@ class TranslationBase {
String get dietZone => localizedValues["dietZone"][locale.languageCode]; String get dietZone => localizedValues["dietZone"][locale.languageCode];
String get useFullInfo => localizedValues["usefulInfo"][locale.languageCode]; String get useFullInfo => localizedValues["usefulInfo"][locale.languageCode];
String get babyAge => localizedValues["babyAge"][locale.languageCode]; String get babyAge => localizedValues["babyAge"][locale.languageCode];
String get babyAgeAvail => localizedValues["babyAgeAvail"][locale.languageCode]; String get babyAgeAvail => localizedValues["babyAgeAvail"][locale.languageCode];
String get deliveryDue => localizedValues["deliveryDue"][locale.languageCode]; String get deliveryDue => localizedValues["deliveryDue"][locale.languageCode];
String get almostInactive => localizedValues["almostInactive"][locale.languageCode]; String get almostInactive => localizedValues["almostInactive"][locale.languageCode];
String get lightActive1 => localizedValues["lightActive1"][locale.languageCode]; String get lightActive1 => localizedValues["lightActive1"][locale.languageCode];
String get veryActive => localizedValues["veryActive"][locale.languageCode]; String get veryActive => localizedValues["veryActive"][locale.languageCode];
String get superActive => localizedValues["superActive"][locale.languageCode];
String get superActive => localizedValues["superActive"][locale.languageCode];
String get dailyIntake => localizedValues["dailyIntake"][locale.languageCode]; String get dailyIntake => localizedValues["dailyIntake"][locale.languageCode];
String get calculateAmount => localizedValues["calculateAmount"][locale.languageCode]; String get calculateAmount => localizedValues["calculateAmount"][locale.languageCode];
String get bodyWillBurn => localizedValues["bodyWillBurn"][locale.languageCode]; String get bodyWillBurn => localizedValues["bodyWillBurn"][locale.languageCode];
String get caloriesEachDay => localizedValues["caloriesEachDay"][locale.languageCode]; String get caloriesEachDay => localizedValues["caloriesEachDay"][locale.languageCode];
String get maintainWeight => localizedValues["maintainWeight"][locale.languageCode]; String get maintainWeight => localizedValues["maintainWeight"][locale.languageCode];
String get mediumFinger => localizedValues["mediumFinger"][locale.languageCode]; String get mediumFinger => localizedValues["mediumFinger"][locale.languageCode];
String get smallFinger => localizedValues["smallFinger"][locale.languageCode]; String get smallFinger => localizedValues["smallFinger"][locale.languageCode];
String get largeFinger => localizedValues["largeFinger"][locale.languageCode]; String get largeFinger => localizedValues["largeFinger"][locale.languageCode];
String get idealBodyWeight => localizedValues["idealBodyWeight"][locale.languageCode]; String get idealBodyWeight => localizedValues["idealBodyWeight"][locale.languageCode];
String get bodyFrameSize => localizedValues["bodyFrameSize"][locale.languageCode]; String get bodyFrameSize => localizedValues["bodyFrameSize"][locale.languageCode];
String get idealWeightRange => localizedValues["idealWeightRange"][locale.languageCode]; String get idealWeightRange => localizedValues["idealWeightRange"][locale.languageCode];
String get currentWeightPerfect => localizedValues["currentWeightPerfect"][locale.languageCode]; String get currentWeightPerfect => localizedValues["currentWeightPerfect"][locale.languageCode];
String get littleBitWeightMore => localizedValues["littleBitWeightMore"][locale.languageCode]; String get littleBitWeightMore => localizedValues["littleBitWeightMore"][locale.languageCode];
String get consultWithDoctor => localizedValues["consultWithDoctor"][locale.languageCode]; String get consultWithDoctor => localizedValues["consultWithDoctor"][locale.languageCode];
String get excessiveObesity => localizedValues["excessiveObesity"][locale.languageCode]; String get excessiveObesity => localizedValues["excessiveObesity"][locale.languageCode];
String get mayWish => localizedValues["mayWish"][locale.languageCode]; String get mayWish => localizedValues["mayWish"][locale.languageCode];
String get underObese => localizedValues["underObese"][locale.languageCode]; String get underObese => localizedValues["underObese"][locale.languageCode];
String get crossedLimits => localizedValues["crossedLimits"][locale.languageCode]; String get crossedLimits => localizedValues["crossedLimits"][locale.languageCode];
String get lowLimits => localizedValues["lowLimits"][locale.languageCode]; String get lowLimits => localizedValues["lowLimits"][locale.languageCode];
String get estimates => localizedValues["estimates"][locale.languageCode]; String get estimates => localizedValues["estimates"][locale.languageCode];
String get submitReview => localizedValues["submitReview"][locale.languageCode]; String get submitReview => localizedValues["submitReview"][locale.languageCode];
String get Protein => localizedValues["Protein"][locale.languageCode]; String get Protein => localizedValues["Protein"][locale.languageCode];

Loading…
Cancel
Save