Merge branch 'sultan-patientapp' into 'development'

Sultan patientapp

See merge request Cloud_Solution/diplomatic-quarter!305
merge-update-with-lab-changes
Mohammad Aljammal 5 years ago
commit bfc687d161

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

@ -14,7 +14,7 @@ const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
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/';
@ -33,7 +33,8 @@ const GET_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_GetAllPoints';
const LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo'; const LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo';
// Delivery Driver // Delivery Driver
const DRIVER_LOCATION = 'Services/Patients.svc/REST/PatientER_GetDriverLocation'; const DRIVER_LOCATION =
'Services/Patients.svc/REST/PatientER_GetDriverLocation';
//weather //weather
const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo'; const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo';
@ -220,9 +221,11 @@ const GET_PATIENT_SHARE =
const GET_PATIENT_APPOINTMENT_HISTORY = const GET_PATIENT_APPOINTMENT_HISTORY =
"Services/Doctors.svc/REST/PateintHasAppoimentHistory"; "Services/Doctors.svc/REST/PateintHasAppoimentHistory";
const SEND_REPORT_EYE_EMAIL = "Services/Notifications.svc/REST/SendGlassesPrescriptionEmail"; const SEND_REPORT_EYE_EMAIL =
"Services/Notifications.svc/REST/SendGlassesPrescriptionEmail";
const SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = "Services/Notifications.svc/REST/SendContactLensPrescriptionEmail"; const SEND_CONTACT_LENS_PRESCRIPTION_EMAIL =
"Services/Notifications.svc/REST/SendContactLensPrescriptionEmail";
//URL to get patient appointment curfew history //URL to get patient appointment curfew history
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY =
@ -509,7 +512,7 @@ const LAKUM_GET_USER_TERMS_AND_CONDITIONS =
"Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy"; "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_RECOMMENDED_PRODUCT = 'alsoProduct/'; const GET_RECOMMENDED_PRODUCT = 'alsoProduct/';
const GET_MOST_VIEWED_PRODUCTS ="mostview?"; const GET_MOST_VIEWED_PRODUCTS = "mostview?";
const GET_NEW_PRODUCTS = "newproducts?"; const GET_NEW_PRODUCTS = "newproducts?";
// Home Health Care // Home Health Care

@ -186,10 +186,7 @@ const Map localizedValues = {
"fileNo": {"en": "File Number", "ar": "رقم الملف"}, "fileNo": {"en": "File Number", "ar": "رقم الملف"},
"fileno": {"en": "File No", "ar": "رقم الملف"}, "fileno": {"en": "File No", "ar": "رقم الملف"},
"forgotFileNo": {"en": "Forgot file Number?", "ar": "نسيت رقم الملف الطبي؟"}, "forgotFileNo": {"en": "Forgot file Number?", "ar": "نسيت رقم الملف الطبي؟"},
"forgotFileNoTitle": { "forgotFileNoTitle": {"en": "Forgot medical file", "ar": "نسيت رقم الملف"},
"en": "Forgot medical file Number",
"ar": "نسيت رقم الملف"
},
"enter-national-id": { "enter-national-id": {
"en": "Please enter mobile number and identification number", "en": "Please enter mobile number and identification number",

@ -87,7 +87,7 @@ class BaseAppClient {
: IS_DENTAL_ALLOWED_BACKEND; : IS_DENTAL_ALLOWED_BACKEND;
} }
body['DeviceTypeID'] = Platform.isAndroid ? 1: 2; body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
if (!body.containsKey('IsPublicRequest')) { if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType') body['PatientType'] = body.containsKey('PatientType')
@ -117,7 +117,8 @@ class BaseAppClient {
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': pharmacyToken, 'Authorization': pharmacyToken,
'Mobilenumber': user != null 'Mobilenumber': user != null
? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) ? Utils.getPhoneNumberWithoutZero(
user['MobileNumber'].toString())
: "", : "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user['PatientID'].toString(), 'Username': user['PatientID'].toString(),
@ -278,8 +279,7 @@ class BaseAppClient {
: IS_DENTAL_ALLOWED_BACKEND; : IS_DENTAL_ALLOWED_BACKEND;
} }
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
body['DeviceTypeID'] = Platform.isAndroid ? 1: 2;
if (!body.containsKey('IsPublicRequest')) { if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType') body['PatientType'] = body.containsKey('PatientType')
@ -507,10 +507,12 @@ class BaseAppClient {
} }
} }
simplePost(String fullUrl, simplePost(
{ Map<String, dynamic> body, String fullUrl, {
Function(dynamic response, int statusCode) onSuccess, Map<String, dynamic> body,
Function(String error, int statusCode) onFailure,}) async { Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
}) async {
String url = fullUrl; String url = fullUrl;
print("URL Query String: $url"); print("URL Query String: $url");
@ -539,9 +541,8 @@ class BaseAppClient {
simpleGet(String fullUrl, simpleGet(String fullUrl,
{Function(dynamic response, int statusCode) onSuccess, {Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure, Function(String error, int statusCode) onFailure,
Map<String, String> queryParams}) async { Map<String, String> queryParams}) async {
String url = fullUrl; String url = fullUrl;
print("URL Query String: $url"); print("URL Query String: $url");
@ -574,12 +575,10 @@ class BaseAppClient {
} }
} }
simplePut(String fullUrl, simplePut(String fullUrl,
{ Map<String, dynamic> body, {Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess, Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure}) async { Function(String error, int statusCode) onFailure}) async {
String url = fullUrl; String url = fullUrl;
print("URL Query String: $url"); print("URL Query String: $url");
@ -608,9 +607,8 @@ class BaseAppClient {
simpleDelete(String fullUrl, simpleDelete(String fullUrl,
{Function(dynamic response, int statusCode) onSuccess, {Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure, Function(String error, int statusCode) onFailure,
Map<String, String> queryParams}) async { Map<String, String> queryParams}) async {
String url = fullUrl; String url = fullUrl;
print("URL Query String: $url"); print("URL Query String: $url");
@ -733,7 +731,7 @@ class BaseAppClient {
: IS_DENTAL_ALLOWED_BACKEND; : IS_DENTAL_ALLOWED_BACKEND;
} }
body['DeviceTypeID'] = Platform.isAndroid ? 1: 2; body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
if (!body.containsKey('IsPublicRequest')) { if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType') body['PatientType'] = body.containsKey('PatientType')

File diff suppressed because it is too large Load Diff

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -13,12 +15,15 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/floating_button_search.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'appointment_history.dart'; import 'appointment_history.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt;
class SendFeedbackPage extends StatefulWidget { class SendFeedbackPage extends StatefulWidget {
@override @override
@ -35,8 +40,10 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
String message; String message;
final formKey = GlobalKey<FormState>(); final formKey = GlobalKey<FormState>();
MessageType messageType = MessageType.NON; MessageType messageType = MessageType.NON;
var _currentLocaleId;
stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord;
var event = RobotProvider();
String getSelected(BuildContext context) { String getSelected(BuildContext context) {
switch (messageType) { switch (messageType) {
case MessageType.ComplaintOnAnAppointment: case MessageType.ComplaintOnAnAppointment:
@ -61,13 +68,10 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
return TranslationBase.of(context).notClassified; return TranslationBase.of(context).notClassified;
} }
setMessageType(MessageType messageType) { setMessageType(MessageType messageType) {
setState(() { setState(() {
this.messageType = messageType; this.messageType = messageType;
}); });
} }
@override @override
@ -116,7 +120,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
getSelected(context), getSelected(context),
variant: 'bodyText', variant: 'bodyText',
), ),
margin: EdgeInsets.only(left: 10,right: 10), margin: EdgeInsets.only(left: 10, right: 10),
), ),
Icon( Icon(
Icons.arrow_drop_down, Icons.arrow_drop_down,
@ -127,8 +131,8 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
), ),
), ),
), ),
if (appointHistory != null && messageType == if (appointHistory != null &&
MessageType.ComplaintOnAnAppointment) messageType == MessageType.ComplaintOnAnAppointment)
InkWell( InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
@ -203,10 +207,13 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
), ),
), ),
), ),
if (messageType == MessageType.ComplaintOnAnAppointment && model.appointHistoryList.length != 0 && if (messageType == MessageType.ComplaintOnAnAppointment &&
model.appointHistoryList.length != 0 &&
isShowListAppointHistory) isShowListAppointHistory)
Container( Container(
height: model.appointHistoryList.length>2?MediaQuery.of(context).size.height * 0.25:MediaQuery.of(context).size.height * 0.15, height: model.appointHistoryList.length > 2
? MediaQuery.of(context).size.height * 0.25
: MediaQuery.of(context).size.height * 0.15,
child: ListView.builder( child: ListView.builder(
itemCount: model.appointHistoryList.length, itemCount: model.appointHistoryList.length,
itemBuilder: (context, index) => InkWell( itemBuilder: (context, index) => InkWell(
@ -336,6 +343,10 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
maxLines: 25, maxLines: 25,
minLines: 13, minLines: 13,
controller: messageController, controller: messageController,
suffixIcon: Icons.mic,
onSuffixTap: () {
openSpeechReco();
},
validator: (value) { validator: (value) {
if (value.isEmpty) if (value.isEmpty)
return TranslationBase.of(context).emptyMessage; return TranslationBase.of(context).emptyMessage;
@ -345,11 +356,12 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
ImageOptions.showImageOptions(context, (String image,File file) { ImageOptions.showImageOptions(context,
(String image, File file) {
setState(() { setState(() {
images.add(image); images.add(image);
}); });
} ); });
}, },
child: Container( child: Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(left: 10, right: 10, top: 15),
@ -427,18 +439,21 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).send, label: TranslationBase.of(context).send,
textColor: Colors.white, textColor: Colors.white,
disabled: (titleController.text.toString().isEmpty || messageController.text.toString().isEmpty|| messageType == MessageType.NON), disabled: (titleController.text.toString().isEmpty ||
messageController.text.toString().isEmpty ||
messageType == MessageType.NON),
onTap: () { onTap: () {
final form = formKey.currentState; final form = formKey.currentState;
if (form.validate()) if (form.validate()) if (messageType != MessageType.NON) {
if (messageType != MessageType.NON){ GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.showMyDialog(context); model
model.sendCOCItem( .sendCOCItem(
title: titleController.text, title: titleController.text,
attachment: images.length > 0 ? images[0] : "", attachment: images.length > 0 ? images[0] : "",
details: messageController.text, details: messageController.text,
cOCTypeName: getCOCName(), cOCTypeName: getCOCName(),
appointHistory:messageType == MessageType.ComplaintOnAnAppointment appointHistory: messageType ==
MessageType.ComplaintOnAnAppointment
? appointHistory ? appointHistory
: null) : null)
.then((value) { .then((value) {
@ -456,9 +471,10 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
AppToast.showErrorToast(message: model.error); AppToast.showErrorToast(message: model.error);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
} }
});} });
else { } else {
AppToast.showErrorToast(message: TranslationBase.of(context).selectPart); AppToast.showErrorToast(
message: TranslationBase.of(context).selectPart);
} }
}, },
), ),
@ -513,28 +529,64 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
}, },
)); ));
} }
openSpeechReco() async {
new RoboSearch(context: context).showAlertDialog(context);
_currentLocaleId =
TranslationBase.of(AppGlobal.context).locale.languageCode;
bool available = await speech.initialize(
onStatus: statusListener, onError: errorListener);
if (available) {
speech.listen(
onResult: resultListener,
// listenMode: ListenMode.confirmation,
localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA',
);
} else {
print("The user has denied the use of speech recognition.");
}
}
void errorListener(SpeechRecognitionError error) {}
void statusListener(String status) {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....';
}
void resultListener(result) {
reconizedWord = result.recognizedWords;
event.setValue({"searchText": reconizedWord});
if (result.finalResult == true) {
setState(() {
RoboSearch.closeAlertDialog(context);
messageController.text = reconizedWord;
});
}
}
} }
class FeedbackTypeDialog extends StatefulWidget { class FeedbackTypeDialog extends StatefulWidget {
final Function(MessageType) onValueSelected; final Function(MessageType) onValueSelected;
final MessageType messageTypeDialog; final MessageType messageTypeDialog;
const FeedbackTypeDialog({Key key, this.onValueSelected, this.messageTypeDialog=MessageType.NON}) : super(key: key); const FeedbackTypeDialog(
{Key key, this.onValueSelected, this.messageTypeDialog = MessageType.NON})
: super(key: key);
@override @override
State createState() => new FeedbackTypeDialogState(); State createState() => new FeedbackTypeDialogState();
} }
class FeedbackTypeDialogState extends State<FeedbackTypeDialog> { class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
MessageType messageTypeDialog = MessageType.NON; MessageType messageTypeDialog = MessageType.NON;
setMessageDialogType(MessageType messageType) { setMessageDialogType(MessageType messageType) {
setState(() { setState(() {
messageTypeDialog = messageType; messageTypeDialog = messageType;
}); });
} }
@override @override
void initState() { void initState() {
messageTypeDialog = widget.messageTypeDialog; messageTypeDialog = widget.messageTypeDialog;
@ -562,10 +614,10 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => setMessageDialogType( onTap: () => setMessageDialogType(MessageType.NON),
MessageType.NON),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).notClassified), title:
Texts(TranslationBase.of(context).notClassified),
leading: Radio( leading: Radio(
value: MessageType.NON, value: MessageType.NON,
groupValue: messageTypeDialog, groupValue: messageTypeDialog,
@ -589,7 +641,8 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
onTap: () => setMessageDialogType( onTap: () => setMessageDialogType(
MessageType.ComplaintOnAnAppointment), MessageType.ComplaintOnAnAppointment),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).complainAppo), title:
Texts(TranslationBase.of(context).complainAppo),
leading: Radio( leading: Radio(
value: MessageType.ComplaintOnAnAppointment, value: MessageType.ComplaintOnAnAppointment,
groupValue: messageTypeDialog, groupValue: messageTypeDialog,
@ -613,7 +666,8 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
onTap: () => setMessageDialogType( onTap: () => setMessageDialogType(
MessageType.ComplaintWithoutAppointment), MessageType.ComplaintWithoutAppointment),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).complainWithoutAppo), title: Texts(
TranslationBase.of(context).complainWithoutAppo),
leading: Radio( leading: Radio(
value: MessageType.ComplaintWithoutAppointment, value: MessageType.ComplaintWithoutAppointment,
groupValue: messageTypeDialog, groupValue: messageTypeDialog,
@ -634,8 +688,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => onTap: () => setMessageDialogType(MessageType.Question),
setMessageDialogType(MessageType.Question),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).question), title: Texts(TranslationBase.of(context).question),
leading: Radio( leading: Radio(
@ -690,7 +743,8 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
value: MessageType.Suggestion, value: MessageType.Suggestion,
groupValue: messageTypeDialog, groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor, activeColor: Theme.of(context).primaryColor,
onChanged: (MessageType value) => setMessageDialogType(value), onChanged: (MessageType value) =>
setMessageDialogType(value),
), ),
), ),
), ),
@ -745,7 +799,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts( child: Texts(
TranslationBase.of(context).ok, TranslationBase.of(context).ok,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
)), )),
), ),

@ -358,7 +358,7 @@ class _HomePageState extends State<HomePage> {
height: 5, height: 5,
), ),
Texts( Texts(
'${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.genderDescription} ${model.user.ageDesc}', '${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${model.user.age.toString() + "y"}',
color: Colors.grey[100], color: Colors.grey[100],
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 14, fontSize: 14,
@ -387,9 +387,10 @@ class _HomePageState extends State<HomePage> {
child: Center( child: Center(
child: Texts( child: Texts(
TranslationBase.of(context) TranslationBase.of(context)
.viewMore, .myMedicalFile,
color: Colors.white, color: Colors.white,
fontSize: 12, fontSize: 12,
textAlign: TextAlign.center,
), ),
), ),
), ),
@ -461,23 +462,27 @@ class _HomePageState extends State<HomePage> {
], ],
), ),
Padding( Padding(
padding: const EdgeInsets.only(bottom: 15, right: 15, left: 15), padding:
const EdgeInsets.only(bottom: 15, right: 15, left: 15),
child: InkWell( child: InkWell(
onTap: (){ onTap: () {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage())); Navigator.of(context).push(MaterialPageRoute(
builder: (context) => PackagesHomePage()));
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
color: Color(0xffB8382C), color: Color(0xffB8382C),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(8), padding: const EdgeInsets.all(8),
child: Row( child: Row(
children: [ children: [
Texts( Texts(
TranslationBase.of(context).offerAndPackages, TranslationBase.of(context).offerAndPackages,
color: Colors.white, fontSize: 20, fontWeight: FontWeight.normal, color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.normal,
), ),
Spacer(), Spacer(),
Image.asset("assets/images/offer_icon.png"), Image.asset("assets/images/offer_icon.png"),
@ -833,7 +838,7 @@ class _HomePageState extends State<HomePage> {
} }
getPharmacyToken(DashboardViewModel model) async { getPharmacyToken(DashboardViewModel model) async {
if(!model.isLogin) { if (!model.isLogin) {
Navigator.push(context, FadePage(page: LandingPagePharmacy())); Navigator.push(context, FadePage(page: LandingPagePharmacy()));
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);

@ -543,7 +543,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
children: [ children: [
HomePage( HomePage(
goToMyProfile: () { goToMyProfile: () {
_changeCurrentTab(0); _changeCurrentTab(1);
}, },
), ),
MedicalProfilePage(), MedicalProfilePage(),

@ -31,6 +31,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:local_auth/auth_strings.dart';
import 'package:local_auth/local_auth.dart'; import 'package:local_auth/local_auth.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
// import 'package:smart_progress_bar/smart_progress_bar.dart'; // import 'package:smart_progress_bar/smart_progress_bar.dart';
@ -383,10 +384,21 @@ class _ConfirmLogin extends State<ConfirmLogin> {
loginWithFingurePrintFace(type, isActive) async { loginWithFingurePrintFace(type, isActive) async {
if (isActive == 1) { if (isActive == 1) {
// this.startBiometricLoginIfAvailable(); // this.startBiometricLoginIfAvailable();
authenticated = await auth.authenticateWithBiometrics( const iosStrings = const IOSAuthMessages(
localizedReason: 'Scan your fingerprint to authenticate', cancelButton: 'cancel',
useErrorDialogs: true, goToSettingsButton: 'settings',
stickyAuth: true); goToSettingsDescription: 'Please set up your Touch ID.',
lockOut: 'Please reenable your Touch ID');
try {
authenticated = await auth.authenticateWithBiometrics(
localizedReason: 'Scan your fingerprint to authenticate',
useErrorDialogs: true,
stickyAuth: true,
iOSAuthStrings: iosStrings);
} on PlatformException catch (e) {
AppToast.showErrorToast(message: e.toString());
}
if (authenticated == true) { if (authenticated == true) {
if (user != null && (user.logInType == 2 || user.logInType == 3)) { if (user != null && (user.logInType == 2 || user.logInType == 3)) {
@ -530,6 +542,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
userData = result.list, userData = result.list,
// sharedPref.setString( // sharedPref.setString(
// BLOOD_TYPE, result['PatientBloodType']), // BLOOD_TYPE, result['PatientBloodType']),
authenticatedUserObject.user = result.list,
sharedPref.setObject(MAIN_USER, result.list), sharedPref.setObject(MAIN_USER, result.list),
sharedPref.setObject(USER_PROFILE, result.list), sharedPref.setObject(USER_PROFILE, result.list),
loginTokenID = result.logInTokenID, loginTokenID = result.logInTokenID,

@ -21,7 +21,7 @@ class _ForgotPassword extends State<ForgotPassword> {
String selectedType = 'Saudi Arabia'; String selectedType = 'Saudi Arabia';
String countryCode = '966'; String countryCode = '966';
final TextEditingController nationalIDorFile = null; final TextEditingController nationalIDorFile = null;
String mobileNo; String mobileNo = "";
var con; var con;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -53,9 +53,15 @@ class _ForgotPassword extends State<ForgotPassword> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[], children: <Widget>[],
), ),
MobileNo( MobileNo(onNumberChange: (value) {
onNumberChange: (value) => {mobileNo = value}, setState(() {
onCountryChange: (value) => countryCode = value), mobileNo = value;
});
}, onCountryChange: (value) {
setState(() {
countryCode = value;
});
}),
], ],
), ),
), ),
@ -73,6 +79,10 @@ class _ForgotPassword extends State<ForgotPassword> {
sendPatientIDBySMS(); sendPatientIDBySMS();
// print(mobileNo.text); // print(mobileNo.text);
}, },
color: mobileNo.length >= 9 == true
? Colors.grey[900]
: Colors.grey,
textColor: Colors.white,
)), )),
], ],
), ),
@ -85,7 +95,7 @@ class _ForgotPassword extends State<ForgotPassword> {
sendPatientIDBySMS() { sendPatientIDBySMS() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
final authService = new AuthProvider(); final authService = new AuthProvider();
authService.sendPatientIDSMS(mobileNo, context).then((res) { authService.sendPatientIDSMS(mobileNo, countryCode, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
this.startSMSService(mobileNo, res['LogInTokenID']); this.startSMSService(mobileNo, res['LogInTokenID']);

@ -265,6 +265,7 @@ class _Login extends State<Login> {
authenticatedUserObject.isLogin = true; authenticatedUserObject.isLogin = true;
appointmentRateViewModel.isLogin = true; appointmentRateViewModel.isLogin = true;
projectViewModel.isLogin = true; projectViewModel.isLogin = true;
authenticatedUserObject.user = result.list;
projectViewModel.user = authenticatedUserObject.user; projectViewModel.user = authenticatedUserObject.user;
await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {

@ -376,26 +376,16 @@ class AuthProvider with ChangeNotifier {
} }
} }
Future<Map> sendPatientIDSMS(mobileNo, context) async { Future<Map> sendPatientIDSMS(mobileNo, zipCode, context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
// var languageID =
// await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
// "LanguageID": languageID == 'ar' ? 1 : 2, "PatientOutSA": zipCode == '+966' ? 0 : 1,
// "IPAdress": "10.20.10.20",
// "VersionID": req.VersionID,
// "Channel": req.Channel,
// "generalid": 'Cs2020@2016\$2958',
// "PatientOutSA": 0,
// "PatientID": 0,
// "TokenID": "",
"PatientMobileNumber": mobileNo, "PatientMobileNumber": mobileNo,
"SearchType": 2, "SearchType": 2,
// "ZipCode": "966", "ZipCode": zipCode,
// "PatientIdentificationID": "",
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
// "SessionID": null
}; };
dynamic localRes; dynamic localRes;

@ -160,8 +160,13 @@ class _AppDrawerState extends State<AppDrawer> {
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
child: DrawerItem( child: DrawerItem(
TranslationBase.of(context).arabicChange, TranslationBase.of(context).arabicChange,
Icons.translate), Padding(
child:
Image.asset('assets/images/lang.png'),
padding: EdgeInsets.all(3)),
isImageIcon: true,
),
onTap: () { onTap: () {
sharedPref.setBool(IS_ROBOT_INIT, null); sharedPref.setBool(IS_ROBOT_INIT, null);
if (projectProvider.isArabic) { if (projectProvider.isArabic) {
@ -304,7 +309,7 @@ class _AppDrawerState extends State<AppDrawer> {
padding: EdgeInsets.only(left: 5, right: 5), padding: EdgeInsets.only(left: 5, right: 5),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
AppText(result.patientName, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), AppText(result.patientName, color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black),
AppText(TranslationBase.of(context).fileno + ": " + result.iD.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black), AppText(TranslationBase.of(context).fileno + ": " + result.patientID.toString(), color: result.responseID == user.patientID ? Color(0xFF40ACC9) : Colors.black),
]))), ]))),
], ],
))) )))

@ -9,19 +9,21 @@ import 'package:flutter/material.dart';
class DrawerItem extends StatefulWidget { class DrawerItem extends StatefulWidget {
final String title; final String title;
final String subTitle; final String subTitle;
final IconData icon; final icon;
final Color textColor; final Color textColor;
final Color iconColor; final Color iconColor;
final bool bottomLine; final bool bottomLine;
final bool sideArrow; final bool sideArrow;
final Widget count; final Widget count;
final bool isImageIcon;
DrawerItem(this.title, this.icon, DrawerItem(this.title, this.icon,
{this.textColor, {this.textColor,
this.iconColor, this.iconColor,
this.subTitle = '', this.subTitle = '',
this.bottomLine = true, this.bottomLine = true,
this.count, this.count,
this.sideArrow = false}); this.sideArrow = false,
this.isImageIcon = false});
@override @override
_DrawerItemState createState() => _DrawerItemState(); _DrawerItemState createState() => _DrawerItemState();
@ -47,13 +49,15 @@ class _DrawerItemState extends State<DrawerItem> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 1, flex: 1,
child: Icon( child: widget.isImageIcon == true
widget.icon, ? widget.icon
color: widget.iconColor == null : Icon(
? Theme.of(context).textTheme.bodyText1.color widget.icon,
: widget.iconColor, color: widget.iconColor == null
size: SizeConfig.imageSizeMultiplier * 5, ? Theme.of(context).textTheme.bodyText1.color
)), : widget.iconColor,
size: SizeConfig.imageSizeMultiplier * 5,
)),
Expanded( Expanded(
flex: 7, flex: 7,
child: Column( child: Column(

@ -1,24 +1,14 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/mobile_number.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../Constants.dart'; import '../../Constants.dart';
// OWNER : Ibrahim albitar
// DATE : 12-04-2020
// DESCRIPTION : Customization for Texts in app
class MobileNo extends StatefulWidget { class MobileNo extends StatefulWidget {
final bool disabled; final bool disabled;
// final String data;
final List<Countries> countries = [
new Countries( name: "Saudi Arabia",
name_ar:"المملكة العربية السعودية", code: '966' ),
new Countries(name: "United Arab Emirates",
name_ar:"الإمارات العربية المتحدة", code: '971'),
];
final double margin; final double margin;
final double marginTop; final double marginTop;
final double marginRight; final double marginRight;
@ -44,9 +34,18 @@ class MobileNo extends StatefulWidget {
} }
class _MobileNo extends State<MobileNo> { class _MobileNo extends State<MobileNo> {
var _selectedType = '966'; var _selectedType = '+966';
String countryCode = '966'; String countryCode = '+966';
List<Countries> counties = [];
ProjectViewModel projectProvider; ProjectViewModel projectProvider;
@override
void initState() {
countriesData.forEach((element) {
this.counties.add(Countries.fromJson(element));
});
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectProvider = Provider.of(context); projectProvider = Provider.of(context);
@ -83,11 +82,13 @@ class _MobileNo extends State<MobileNo> {
_selectedType = value; _selectedType = value;
}) })
}, },
items: widget.countries items: counties.map<DropdownMenuItem<String>>(
.map<DropdownMenuItem<String>>((Countries value) { (Countries value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value.code, value: value.code,
child: Text(projectProvider.isArabic == true ? value.name_ar : value.name), child: Text(projectProvider.isArabic == true
? value.nameAr
: value.name),
); );
}).toList())))), }).toList())))),
), ),
@ -124,13 +125,19 @@ class _MobileNo extends State<MobileNo> {
left: widget.marginLeft), left: widget.marginLeft),
child: TextField( child: TextField(
controller: widget.controller, controller: widget.controller,
keyboardType: TextInputType.phone, keyboardType: TextInputType.number,
maxLength: 10,
// maxLengthEnforced: true,
// onChanged: (value) { // onChanged: (value) {
// widget.controller.text = countryCode; // widget.controller.text = countryCode;
// }, // },
onChanged: (value) => widget.onNumberChange(value), onChanged: (value) => widget.onNumberChange(value),
decoration: InputDecoration( decoration: InputDecoration(
border: InputBorder.none, hintText: '5xxxxxxxx'), counterText: "",
border: InputBorder.none,
hintText: '5xxxxxxxx'),
), ),
), ),
) )
@ -140,10 +147,10 @@ class _MobileNo extends State<MobileNo> {
} }
} }
class Countries { // class Countries {
final String name; // final String name;
final String name_ar; // final String name_ar;
final String code; // final String code;
Countries({this.name, this.name_ar, this.code}); // Countries({this.name, this.name_ar, this.code});
} // }

Loading…
Cancel
Save