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

merge-requests/809/head
mosazaid 4 years ago
commit a4ba2de459

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

@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";
@ -300,6 +300,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;

@ -551,7 +551,7 @@ const Map<String, Map<String, String>> localizedValues = {
"en": "Please enter the code",
"ar": "الرجاء ادخال الرمز"
},
"youDon\"tHaveAnyPatient": {
"youDontHaveAnyPatient": {
"en": "No data found for the selected search criteria",
"ar": "لا توجد بيانات لمعايير البحث المختارة"
},
@ -2541,7 +2541,27 @@ const Map<String, Map<String, String>> localizedValues = {
},
"roomNo":{
"en":"Room No",
"ar":"رقم الغرفة"
"ar":"رقم الغرفة"
},
"replayCallStatus":{
"en":"Called",
"ar":"تم الاتصال"
},
"patientArrived":{
"en":"Patient Arrived",
"ar":"تم الاتصال"
},
"calledAndNoResponse":{
"en":"Called And No Response",
"ar":"تم الاتصال"
},
"underProcess":{
"en":"Under Process",
"ar":"تم الاتصال"
},
"textResponse":{
"en":"Text Response",
"ar":"تم الاتصال"
}
};

@ -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

@ -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,

@ -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