|
|
|
|
@ -80,9 +80,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
|
|
|
|
|
return BaseView<DashboardViewModel>(
|
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
model
|
|
|
|
|
.startHomeScreenServices(projectsProvider, authenticationViewModel)
|
|
|
|
|
.then((value) {
|
|
|
|
|
model.startHomeScreenServices(projectsProvider, authenticationViewModel).then((value) {
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
|
|
|
|
if (model.radiologyCriticalFindingModel != null) {
|
|
|
|
|
print("onModelReady radiologyCriticalFindingModel!!!");
|
|
|
|
|
@ -113,12 +111,9 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
//TODO Elham* make it componet
|
|
|
|
|
Container(
|
|
|
|
|
width: 40,
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
left: projectsProvider.isArabic ? 0 : 32,
|
|
|
|
|
right: projectsProvider.isArabic ? 23 : 0),
|
|
|
|
|
margin: EdgeInsets.only(left: projectsProvider.isArabic ? 0 : 32, right: projectsProvider.isArabic ? 23 : 0),
|
|
|
|
|
child: IconButton(
|
|
|
|
|
icon: SvgPicture.asset('assets/images/svgs/menu.svg',
|
|
|
|
|
height: 25, width: 10),
|
|
|
|
|
icon: SvgPicture.asset('assets/images/svgs/menu.svg', height: 25, width: 10),
|
|
|
|
|
iconSize: 15,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
onPressed: () => Scaffold.of(context).openDrawer(),
|
|
|
|
|
@ -126,8 +121,6 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
Column(children: <Widget>[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// InkWell(onTap: (){
|
|
|
|
|
// AppPermissionsUtils.requestVideoCallPermission(
|
|
|
|
|
@ -322,14 +315,10 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
showRadiologyFindingDialog(DashboardViewModel model) async{
|
|
|
|
|
await Utils.showConfirmationDialog(
|
|
|
|
|
context, model.radiologyCriticalFindingModel?.notificationMesssage ??'test radiology',
|
|
|
|
|
() async {
|
|
|
|
|
showRadiologyFindingDialog(DashboardViewModel model) async {
|
|
|
|
|
await Utils.showConfirmationDialog(context, model.radiologyCriticalFindingModel?.notificationMesssage ?? 'test radiology', () async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await model.acknowledgeRadiologyCriticalFinding(
|
|
|
|
|
model.radiologyCriticalFindingModel?.invoiceNo?.toString() ?? '',
|
|
|
|
|
model.radiologyCriticalFindingModel?.invoiceLineItemNo?.toString() ?? '');
|
|
|
|
|
await model.acknowledgeRadiologyCriticalFinding(model.radiologyCriticalFindingModel?.invoiceNo?.toString() ?? '', model.radiologyCriticalFindingModel?.invoiceLineItemNo?.toString() ?? '');
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
}, isShowCancelButton: false);
|
|
|
|
|
@ -351,27 +340,19 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
_showErrorBottomSheet(context, TranslationBase.of(context).youHavePendingInterventions);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Widget> homePatientsCardsWidget(
|
|
|
|
|
DashboardViewModel model, projectsProvider) {
|
|
|
|
|
List<Widget> homePatientsCardsWidget(DashboardViewModel model, projectsProvider) {
|
|
|
|
|
colorIndex = 0;
|
|
|
|
|
|
|
|
|
|
List<LinearGradient> backgroundColors = [];
|
|
|
|
|
backgroundColors.add(LinearGradient(
|
|
|
|
|
begin: Alignment(-1.0, -2.0),
|
|
|
|
|
end: Alignment(1.0, 2.0),
|
|
|
|
|
colors: [
|
|
|
|
|
AppGlobal.appRedColor,
|
|
|
|
|
Color(0xFFAD3B3B),
|
|
|
|
|
])); //AppGlobal.appRedColor;
|
|
|
|
|
backgroundColors.add(
|
|
|
|
|
LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [
|
|
|
|
|
backgroundColors.add(LinearGradient(begin: Alignment(-1.0, -2.0), end: Alignment(1.0, 2.0), colors: [
|
|
|
|
|
AppGlobal.appRedColor,
|
|
|
|
|
Color(0xFFAD3B3B),
|
|
|
|
|
])); //AppGlobal.appRedColor;
|
|
|
|
|
backgroundColors.add(LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [
|
|
|
|
|
Color(0xFFC9C9C9),
|
|
|
|
|
Color(0xFFC9C9C9),
|
|
|
|
|
]));
|
|
|
|
|
backgroundColors.add(LinearGradient(
|
|
|
|
|
begin: Alignment.center,
|
|
|
|
|
end: Alignment.center,
|
|
|
|
|
colors: [Color(0xFF71787E), AppGlobal.appTextColor]));
|
|
|
|
|
backgroundColors.add(LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [Color(0xFF71787E), AppGlobal.appTextColor]));
|
|
|
|
|
List<Color> backgroundIconColors = [];
|
|
|
|
|
backgroundIconColors.add(Colors.white12);
|
|
|
|
|
backgroundIconColors.add(Colors.white38);
|
|
|
|
|
@ -390,8 +371,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
cardIcon: DoctorApp.livecare,
|
|
|
|
|
textColor: textColors[colorIndex],
|
|
|
|
|
iconSize: 21,
|
|
|
|
|
text:
|
|
|
|
|
"${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}",
|
|
|
|
|
text: "${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}",
|
|
|
|
|
onTap: () {
|
|
|
|
|
// TODO MOSA TEST
|
|
|
|
|
// PatiantInformtion patient = PatiantInformtion(
|
|
|
|
|
@ -438,22 +418,19 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
));
|
|
|
|
|
changeColorIndex();
|
|
|
|
|
|
|
|
|
|
if (model.doctorProfile !=null && !Utils.isVidaPlusInPatientProject(projectsProvider, model.doctorProfile!.projectID!)) {
|
|
|
|
|
if (model.doctorProfile != null && !Utils.isVidaPlusInPatientProject(projectsProvider, model.doctorProfile!.projectID!)) {
|
|
|
|
|
patientCards.add(HomePatientCard(
|
|
|
|
|
gradient: backgroundColors[colorIndex],
|
|
|
|
|
backgroundIconColor: backgroundIconColors[colorIndex],
|
|
|
|
|
cardIcon: DoctorApp.inpatient,
|
|
|
|
|
textColor: textColors[colorIndex],
|
|
|
|
|
text: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.myInPatient,
|
|
|
|
|
text: TranslationBase.of(context).myInPatient,
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: InPatientScreen(
|
|
|
|
|
specialClinic: model.getSpecialClinic(
|
|
|
|
|
clinicId ?? projectsProvider.doctorClinicsList[0].clinicID),
|
|
|
|
|
specialClinic: model.getSpecialClinic(clinicId ?? projectsProvider.doctorClinicsList[0].clinicID),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
@ -469,12 +446,10 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
cardIcon: DoctorApp.search_medicines,
|
|
|
|
|
textColor: textColors[2],
|
|
|
|
|
text: TranslationBase.of(context).interventionPharmacyApproval,
|
|
|
|
|
fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width) *
|
|
|
|
|
(SizeConfig.isHeightVeryShort ? 10 : 9),
|
|
|
|
|
fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width) * (SizeConfig.isHeightVeryShort ? 10 : 9),
|
|
|
|
|
onTap: () {
|
|
|
|
|
if (!model.isInfectiousDiseaseConsultant) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
TranslationBase.of(context).unableToPerformTheAction);
|
|
|
|
|
DrAppToastMsg.showErrorToast(TranslationBase.of(context).unableToPerformTheAction);
|
|
|
|
|
}
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
@ -511,19 +486,13 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
textColor: textColors[colorIndex],
|
|
|
|
|
text: TranslationBase.of(context).myOutPatient_2lines,
|
|
|
|
|
onTap: () {
|
|
|
|
|
String date = AppDateUtils.convertDateToFormat(
|
|
|
|
|
DateTime(
|
|
|
|
|
DateTime.now().year, DateTime.now().month, DateTime.now().day),
|
|
|
|
|
'yyyy-MM-dd');
|
|
|
|
|
String date = AppDateUtils.convertDateToFormat(DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd');
|
|
|
|
|
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => OutPatientsScreen(
|
|
|
|
|
patientSearchRequestModel: PatientSearchRequestModel(
|
|
|
|
|
from: date,
|
|
|
|
|
to: date,
|
|
|
|
|
doctorID: authenticationViewModel.doctorProfile!.doctorID),
|
|
|
|
|
patientSearchRequestModel: PatientSearchRequestModel(from: date, to: date, doctorID: authenticationViewModel.doctorProfile!.doctorID),
|
|
|
|
|
),
|
|
|
|
|
settings: RouteSettings(name: 'OutPatientsScreen'),
|
|
|
|
|
));
|
|
|
|
|
@ -583,10 +552,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
));
|
|
|
|
|
changeColorIndex();
|
|
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
...List.generate(patientCards.length, (index) => patientCards[index])
|
|
|
|
|
.toList()
|
|
|
|
|
];
|
|
|
|
|
return [...List.generate(patientCards.length, (index) => patientCards[index]).toList()];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
changeColorIndex() {
|
|
|
|
|
@ -595,15 +561,17 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
colorIndex = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void _showErrorBottomSheet(BuildContext context, String errorMessage) {
|
|
|
|
|
showModalBottomSheet(
|
|
|
|
|
isDismissible:true,
|
|
|
|
|
enableDrag:false,
|
|
|
|
|
isDismissible: true,
|
|
|
|
|
enableDrag: false,
|
|
|
|
|
context: context,
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
|
|
|
|
|
),
|
|
|
|
|
backgroundColor: Colors.red[50], // Light red background
|
|
|
|
|
backgroundColor: Colors.red[50],
|
|
|
|
|
// Light red background
|
|
|
|
|
builder: (context) {
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: const EdgeInsets.all(16.0),
|
|
|
|
|
@ -615,13 +583,17 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
children: [
|
|
|
|
|
Icon(Icons.error_outline, color: Colors.red, size: 40),
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
},
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: Icon(Icons.close,color: Colors.red,),
|
|
|
|
|
))
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
},
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
child: Icon(
|
|
|
|
|
Icons.close,
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 10),
|
|
|
|
|
@ -637,26 +609,28 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 15),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: SizeConfig.realScreenWidth! * .4,
|
|
|
|
|
child:AppButton(
|
|
|
|
|
width: SizeConfig.realScreenWidth! * .4,
|
|
|
|
|
child: AppButton(
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
onPressed: () => { // Navigator.pop(context);
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => PharmacyIntervention(),
|
|
|
|
|
settings: RouteSettings(name: 'PharmacyIntervention'),
|
|
|
|
|
))},
|
|
|
|
|
title: TranslationBase.of(context).open,
|
|
|
|
|
|
|
|
|
|
)),
|
|
|
|
|
onPressed: () => {
|
|
|
|
|
// Navigator.pop(context);
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => PharmacyIntervention(),
|
|
|
|
|
settings: RouteSettings(name: 'PharmacyIntervention'),
|
|
|
|
|
))
|
|
|
|
|
},
|
|
|
|
|
title: TranslationBase.of(context).open,
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
void startZoom(){
|
|
|
|
|
|
|
|
|
|
void startZoom() {
|
|
|
|
|
var zoom = ZoomVideoSdk();
|
|
|
|
|
InitConfig initConfig = InitConfig(
|
|
|
|
|
domain: "zoom.us",
|
|
|
|
|
|