Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into all_special_lab_result

merge-requests/812/head
hussam al-habibeh 4 years ago
commit 19487ba435

@ -0,0 +1 @@
include ':app'

@ -26,7 +26,8 @@ class BaseAppClient {
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
bool isLiveCare = false}) async {
bool isLiveCare = false,
bool isFallLanguage=false}) async {
String url;
if (isLiveCare)
url = BASE_URL_LIVE_CARE + endPoint;
@ -58,12 +59,13 @@ class BaseAppClient {
body['TokenID'] = token ?? '';
}
// body['TokenID'] = "@dm!n" ?? '';
String lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar')
body['LanguageID'] = 1;
else
body['LanguageID'] = 2;
if(!isFallLanguage) {
String lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar')
body['LanguageID'] = 1;
else
body['LanguageID'] = 2;
}
body['stamp'] = DateTime.now().toIso8601String();
// if(!body.containsKey("IPAdress"))
body['IPAdress'] = IP_ADDRESS;

@ -302,6 +302,9 @@ const GENERAL_ID = 'Cs2020@2016\$2958';
const PATIENT_TYPE = 1;
const PATIENT_TYPE_ID = 1;
const Color IN_PROGRESS_COLOR = Color(0xFFCC9B14);
/// Timer Info
const TIMER_MIN = 10;

File diff suppressed because it is too large Load Diff

@ -21,6 +21,6 @@ class ScheduleService extends BaseService {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestSchedule.toJson(),);
}, body: _requestSchedule.toJson(),isFallLanguage: true);
}
}

@ -142,7 +142,7 @@ class AuthenticationViewModel extends BaseViewModel {
iMEI: user.iMEI,
facilityId: user.projectID,
memberID: user.doctorID,
loginDoctorID: user.doctorID,
loginDoctorID: int.parse(user.editedBy.toString()),
zipCode: user.outSA == true ? '971' : '966',
mobileNumber: user.mobile,
oTPSendType: authMethodType.getTypeIdService(),
@ -172,7 +172,7 @@ class AuthenticationViewModel extends BaseViewModel {
error = _authService.error;
setState(ViewState.ErrorLocal);
} else {
await sharedPref.setString(LOGIN_TOKEN_ID,
await sharedPref.setString(TOKEN,
_authService.activationCodeForDoctorAppRes.logInTokenID);
setState(ViewState.Idle);
}
@ -191,14 +191,14 @@ class AuthenticationViewModel extends BaseViewModel {
projectID: await sharedPref.getInt(PROJECT_ID) != null
? await sharedPref.getInt(PROJECT_ID)
: user.projectID,
logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID),
logInTokenID: await sharedPref.getString(TOKEN),
activationCode: activationCode ?? '0000',
memberID:userInfo.userID!=null? int.parse(userInfo.userID):user.doctorID ,
password: userInfo.password,
facilityId:userInfo.projectID!=null? userInfo.projectID.toString():user.projectID.toString(),
oTPSendType: await sharedPref.getInt(OTP_TYPE),
iMEI: localToken,
loginDoctorID:userInfo.userID!=null? int.parse(userInfo.userID):user.doctorID,// loggedUser.listMemberInformation[0].employeeID,
loginDoctorID:userInfo.userID!=null? int.parse(userInfo.userID):user.editedBy,// loggedUser.listMemberInformation[0].employeeID,
isForSilentLogin:isSilentLogin,
generalid: "Cs2020@2016\$2958");
await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp);
@ -258,7 +258,7 @@ class AuthenticationViewModel extends BaseViewModel {
sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID);
await sharedPref.setString(VIDA_REFRESH_TOKEN_ID,
sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID);
await sharedPref.setString(LOGIN_TOKEN_ID,
await sharedPref.setString(TOKEN,
sendActivationCodeForDoctorAppResponseModel.authenticationTokenID);
}

@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_analytics/observer.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:hexcolor/hexcolor.dart';
@ -56,6 +57,8 @@ class MyApp extends StatelessWidget {
TranslationBaseDelegate(),
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
DefaultCupertinoLocalizations.delegate
],
supportedLocales: [
const Locale('ar', ''), // Arabic

@ -55,7 +55,7 @@ class RequestSchedule {
data['ClinicID'] = this.clinicID;
data['DoctorID'] = this.doctorID;
data['DoctorWorkingHoursDays'] = this.doctorWorkingHoursDays;
data['LanguageID'] = this.languageID;
data['LanguageID'] = 2;
data['stamp'] = this.stamp;
data['IPAdress'] = this.iPAdress;
data['VersionID'] = this.versionID;

@ -455,7 +455,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
GifLoaderDialogUtils.hideDialog(context);
Helpers.showErrorToast(authenticationViewModel.error);
} else {
await sharedPref.setString(LOGIN_TOKEN_ID,
await sharedPref.setString(TOKEN,
authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID);
if (authMethodType == AuthMethodTypes.SMS ||
authMethodType == AuthMethodTypes.WhatsApp) {

@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -17,19 +18,31 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:url_launcher/url_launcher.dart';
class DoctorReplayChat extends StatelessWidget {
class DoctorReplayChat extends StatefulWidget {
final ListGtMyPatientsQuestions reply;
TextEditingController msgController = TextEditingController();
final DoctorReplayViewModel previousModel;
bool showMsgBox = false;
DoctorReplayChat(
{Key key, this.reply, this.previousModel,
});
@override
_DoctorReplayChatState createState() => _DoctorReplayChatState();
}
class _DoctorReplayChatState extends State<DoctorReplayChat> {
TextEditingController msgController = TextEditingController();
@override
Widget build(BuildContext context) {
if(reply.doctorResponse.isNotEmpty){
msgController.text = reply.doctorResponse;
if(widget.reply.doctorResponse.isNotEmpty){
msgController.text = widget.reply.doctorResponse;
} else {
widget.showMsgBox = true;
}
return BaseView<DoctorReplayViewModel>(
onModelReady: (model) async {
@ -72,7 +85,7 @@ class DoctorReplayChat extends StatelessWidget {
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: reply.patientName
text: widget.reply.patientName
.toString(),
style: TextStyle(
color: Color(0xFF2B353E),
@ -135,7 +148,7 @@ class DoctorReplayChat extends StatelessWidget {
width: 50,
height: 50,
child: Image.asset(
reply.gender == 1
widget.reply.gender == 1
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
@ -146,7 +159,7 @@ class DoctorReplayChat extends StatelessWidget {
Container(
width: MediaQuery.of(context).size.width * 0.31,
child: AppText(
reply.patientName
widget.reply.patientName
.toString(),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,
fontFamily: 'Poppins',
@ -159,7 +172,7 @@ class DoctorReplayChat extends StatelessWidget {
margin: EdgeInsets.symmetric(horizontal: 0),
child: InkWell(
onTap: () {
launch("tel://" +reply.mobileNumber);
launch("tel://" +widget.reply.mobileNumber);
},
child: Icon(
Icons.phone,
@ -174,14 +187,14 @@ class DoctorReplayChat extends StatelessWidget {
children: [
AppText(
reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
widget.reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
fontWeight: FontWeight
.w500,
color: Colors.white,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8,
),
AppText(
reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getHour(DateTime.now()),
widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getHour(DateTime.now()),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8,
fontFamily: 'Poppins',
color: Colors.white,
@ -205,7 +218,7 @@ class DoctorReplayChat extends StatelessWidget {
child: Container(
width: MediaQuery.of(context).size.width * 0.7,
child: AppText(
reply.remarks,
widget.reply.remarks,
fontSize: 15,
fontFamily: 'Poppins',
color: Colors.white,
@ -223,7 +236,7 @@ class DoctorReplayChat extends StatelessWidget {
SizedBox(height: 30,),
SizedBox(height: 30,),
if(reply.doctorResponse != null && reply.doctorResponse.isNotEmpty)
if(widget.reply.doctorResponse != null && widget.reply.doctorResponse.isNotEmpty)
Align(
alignment: Alignment.centerRight,
child: Container(
@ -256,7 +269,7 @@ class DoctorReplayChat extends StatelessWidget {
width: 50,
height: 50,
child: Image.asset(
previousModel.doctorProfile.gender == 0
widget.previousModel.doctorProfile.gender == 0
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover,
@ -267,7 +280,7 @@ class DoctorReplayChat extends StatelessWidget {
Container(
width: MediaQuery.of(context).size.width * 0.35,
child: AppText(
previousModel.doctorProfile.doctorName,
widget.previousModel.doctorProfile.doctorName,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,
fontFamily: 'Poppins',
color: Color(0xFF2B353E),
@ -282,14 +295,14 @@ class DoctorReplayChat extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
AppText(
reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
widget.reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()),
fontWeight: FontWeight
.w500,
color: Color(0xFF2B353E),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8,
),
AppText(
reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getHour(DateTime.now()),
widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getHour(DateTime.now()),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8,
fontFamily: 'Poppins',
color: Color(0xFF2B353E),
@ -313,7 +326,7 @@ class DoctorReplayChat extends StatelessWidget {
child: Container(
width: MediaQuery.of(context).size.width * 0.7,
child: AppText(
reply.doctorResponse,
widget.reply.doctorResponse,
fontSize: 15,
fontFamily: 'Poppins',
color: Color(0xFF2B353E),
@ -338,9 +351,39 @@ class DoctorReplayChat extends StatelessWidget {
),
),
Positioned(
bottom: 0,
child: Container(
bottom: !widget.showMsgBox?80:0,
left: !widget.showMsgBox?20:0,
child: !widget.showMsgBox? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText("You already replied to this question."),
SizedBox(height: 10,),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
SizedBox(width: 20,),
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Center(
child: AppButton(
fontWeight: FontWeight.w700,
color: Colors.green[600],
title: "Update Your Answer", //TranslationBase.of(context).close,
onPressed: () {
setState(() {
widget.showMsgBox = true;
});
},
),
),
),
],
)
],
):Container(
width:MediaQuery.of(context).size.width * 1,
height: MediaQuery.of(context).size.height * 0.12,
child: Column(
@ -365,21 +408,16 @@ class DoctorReplayChat extends StatelessWidget {
return;
} else {
GifLoaderDialogUtils.showMyDialog(context);
await previousModel.createDoctorResponse(msgController.text, reply);
if(previousModel.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(previousModel.error);
await widget.previousModel.createDoctorResponse(msgController.text, widget.reply);
if(widget.previousModel.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(widget.previousModel.error);
} else {
DrAppToastMsg.showSuccesToast("Thank you for your replay ");
await previousModel.getDoctorReply(isLocalBusy: false);
await widget.previousModel.getDoctorReply(isLocalBusy: false);
Navigator.pop(context);
}
GifLoaderDialogUtils.hideDialog(context);
}
},
// hintColor: Colors.black,
fontWeight: FontWeight.w500,

@ -90,7 +90,7 @@ class _DoctorReplyScreenState extends State<DoctorReplyScreen> {
);
}),
onNotification: (t) {
if (t is ScrollEndNotification &&
if (t is ScrollUpdateNotification && t.metrics.pixels >= t.metrics.maxScrollExtent - 50 &&
model.state != ViewState.BusyLocal) {
setState(() {
pageIndex++;

@ -249,7 +249,7 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen>
TranslationBase.of(context).inPatientAll,
counter: model.inPatientList.length),
tabWidget(
screenSize, _activeTab == 1, "My InPatients",
screenSize, _activeTab == 1, TranslationBase.of(context).inPatient,
counter: model.myIinPatientList.length),
tabWidget(screenSize, _activeTab == 2,
TranslationBase.of(context).discharged),

@ -45,25 +45,6 @@ class LabResultWidget extends StatelessWidget {
Row(
children: [
AppText(filterName),
InkWell(
onTap: (){
Navigator.push(
context,
FadePage(
page: LabResultHistoryPage(
filterName: filterName,
patientLabOrder: patientLabOrder,
patient: patient,
),
),
);
},
child: AppText(
" (show details)",
color: Colors.blue,
fontSize: 12,
),
),
],
),
InkWell(
@ -138,7 +119,27 @@ class LabResultWidget extends StatelessWidget {
...List.generate(
patientLabResultList.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
InkWell(
onTap: (){
Navigator.push(
context,
FadePage(
page: LabResultHistoryPage(
filterName: patientLabResultList[index].description,
patientLabOrder: patientLabOrder,
patient: patient,
),
),
);
},
child: AppText(
" (show details)",
color: Colors.blue,
fontSize: 12,
),
),
Row(
children: [
Expanded(

@ -75,6 +75,8 @@ class MedicalReportDetailPage extends StatelessWidget {
),
),
child: Html(
data: medicalReport.reportDataHtml ?? ""
),
) : Container(

@ -336,7 +336,7 @@ class TranslationBase {
localizedValues['pleaseEnterTheCode'][locale.languageCode];
String get youDontHaveAnyPatient =>
localizedValues['youDon\'tHaveAnyPatient'][locale.languageCode];
localizedValues['youDontHaveAnyPatient'][locale.languageCode];
String get youDoNotHaveAnyItem =>
localizedValues['youDoNotHaveAnyItem'][locale.languageCode];
@ -1373,6 +1373,11 @@ class TranslationBase {
String get textCopiedSuccessfully => localizedValues['textCopiedSuccessfully'][locale.languageCode];
String get roomNo => localizedValues['roomNo'][locale.languageCode];
String get seeMore => localizedValues['seeMore'][locale.languageCode];
String get replayCallStatus => localizedValues['replayCallStatus'][locale.languageCode];
String get patientArrived => localizedValues['patientArrived'][locale.languageCode];
String get calledAndNoResponse => localizedValues['calledAndNoResponse'][locale.languageCode];
String get underProcess => localizedValues['underProcess'][locale.languageCode];
String get textResponse => localizedValues['textResponse'][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
@ -30,9 +31,9 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
return Container(
child: CardWithBgWidget(
bgColor:
widget.reply.status == 2
? Color(0xFF2E303A)
: Color(0xFFD02127),
widget.reply.infoStatus == 4
? IN_PROGRESS_COLOR
: widget.reply.infoStatus == 3 ?Color(0xFFD02127): Colors.green[600],
hasBorder: false,
widget: Container(
// padding: EdgeInsets.only(left: 20, right: 0, bottom: 0),
@ -50,11 +51,11 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: widget.reply.status==2 ? "Active":widget.reply.status==1?"Hold":"Cancelled",//TranslationBase.of(context).replied :TranslationBase.of(context).unReplied ,
text: widget.reply.infoStatus ==1? TranslationBase.of(context).replayCallStatus:widget.reply.infoStatus ==2? TranslationBase.of(context).patientArrived:widget.reply.infoStatus ==3? TranslationBase.of(context).calledAndNoResponse:widget.reply.infoStatus ==4? TranslationBase.of(context).underProcess:widget.reply.infoStatus ==6? TranslationBase.of(context).textResponse:'' ,//widget.reply.status==2 ? "Active":widget.reply.status==1?"Hold":"Cancelled",//TranslationBase.of(context).replied :TranslationBase.of(context).unReplied ,
style: TextStyle(
color: widget.reply.status == 2
? Color(0xFF2E303A)
: Color(0xFFD02127),
color: widget.reply.infoStatus == 4
? IN_PROGRESS_COLOR
: widget.reply.infoStatus == 3 ?Color(0xFFD02127): Colors.green[600],
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',

Loading…
Cancel
Save