Radiology Critical finding CR Implemented

development-3.3
haroon amjad 2 years ago
parent 519b7cfc2e
commit ee86db3778

@ -7,9 +7,9 @@ const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
const DOCTOR_ROTATION = 'https://doctorrota.hmg.com/'; const DOCTOR_ROTATION = 'https://doctorrota.hmg.com/';
// const BASE_URL_LIVE_CARE = 'https://livecareuat.hmg.com/'; // const BASE_URL_LIVE_CARE = 'https://livecareuat.hmg.com/';
const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://webservices.hmg.com/'; // const BASE_URL = 'https://webservices.hmg.com/';
@ -281,6 +281,10 @@ const DOCTOR_ER_SIGN_ASSESSMENT = "Services/DoctorApplication.svc/REST/DoctorApp
const DOCTOR_SCHEDULE = "api/ScheduledSchedule/GetallSchedulebyUser"; const DOCTOR_SCHEDULE = "api/ScheduledSchedule/GetallSchedulebyUser";
const DOCTOR_RADIOLOGY_CRITICAL_FINDINGS = "Services/DoctorApplication.svc/REST/FetchRadCriticalFinding";
const ACKNOWLEDGE_RADIOLOGY_CRITICAL_FINDINGS = "Services/DoctorApplication.svc/REST/Acknowledgeradcriticalfindings";
var selectedPatientType = 1; var selectedPatientType = 1;
//*********change value to decode json from Dropdown ************ //*********change value to decode json from Dropdown ************

@ -0,0 +1,60 @@
class RadiologyCriticalFindingModel {
String clinicName;
String doctorName;
String imageURL;
int invoiceLineItemNo;
int invoiceNo;
String notificationMesssage;
int patientId;
String patientName;
String procedureName;
String reportData;
String reportOn;
String resultFindings;
RadiologyCriticalFindingModel(
{this.clinicName,
this.doctorName,
this.imageURL,
this.invoiceLineItemNo,
this.invoiceNo,
this.notificationMesssage,
this.patientId,
this.patientName,
this.procedureName,
this.reportData,
this.reportOn,
this.resultFindings});
RadiologyCriticalFindingModel.fromJson(Map<String, dynamic> json) {
clinicName = json['clinicName'];
doctorName = json['doctorName'];
imageURL = json['imageURL'];
invoiceLineItemNo = json['invoiceLineItemNo'];
invoiceNo = json['invoiceNo'];
notificationMesssage = json['notificationMesssage'];
patientId = json['patientId'];
patientName = json['patientName'];
procedureName = json['procedureName'];
reportData = json['reportData'];
reportOn = json['reportOn'];
resultFindings = json['resultFindings'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['clinicName'] = this.clinicName;
data['doctorName'] = this.doctorName;
data['imageURL'] = this.imageURL;
data['invoiceLineItemNo'] = this.invoiceLineItemNo;
data['invoiceNo'] = this.invoiceNo;
data['notificationMesssage'] = this.notificationMesssage;
data['patientId'] = this.patientId;
data['patientName'] = this.patientName;
data['procedureName'] = this.procedureName;
data['reportData'] = this.reportData;
data['reportOn'] = this.reportOn;
data['resultFindings'] = this.resultFindings;
return data;
}
}

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/dashboard/radiology_critical_finding_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart';
@ -7,8 +8,12 @@ import '../../model/dashboard/doctor_schedule.dart';
class DashboardService extends BaseService { class DashboardService extends BaseService {
List<DashboardModel> _dashboardItemsList = []; List<DashboardModel> _dashboardItemsList = [];
RadiologyCriticalFindingModel _radiologyCriticalFindingModel;
List<DashboardModel> get dashboardItemsList => _dashboardItemsList; List<DashboardModel> get dashboardItemsList => _dashboardItemsList;
RadiologyCriticalFindingModel get radiologyCriticalFindingModel => _radiologyCriticalFindingModel;
bool hasVirtualClinic = false; bool hasVirtualClinic = false;
String sServiceID; String sServiceID;
@ -48,4 +53,46 @@ class DashboardService extends BaseService {
}, },
); );
} }
Future acknowledgeDoctorHasRadiologyFindings(String invoiceNo, String invoiceLineItemNo) async {
hasError = false;
await getDoctorProfile(isGetProfile: true);
await baseAppClient.post(
ACKNOWLEDGE_RADIOLOGY_CRITICAL_FINDINGS,
onSuccess: (dynamic response, int statusCode) {
// _radiologyCriticalFindingModel = RadiologyCriticalFindingModel.fromJson(response["RadiologyVMEntityListInfoResponse"]["entityList"][0]);
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {
"DoctorID": doctorProfile?.doctorID, // test user 9920
"LoginDoctorID": doctorProfile?.doctorID,
"invoiceNo": invoiceNo,
"invoiceLineItemNo": invoiceLineItemNo,
},
);
}
Future checkDoctorHasRadiologyFindings() async {
hasError = false;
await getDoctorProfile(isGetProfile: true);
await baseAppClient.post(
DOCTOR_RADIOLOGY_CRITICAL_FINDINGS,
onSuccess: (dynamic response, int statusCode) {
if(response["RadiologyVMEntityListInfoResponse"]["entityList"].length != 0) {
_radiologyCriticalFindingModel = RadiologyCriticalFindingModel.fromJson(response["RadiologyVMEntityListInfoResponse"]["entityList"][0]);
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {
"DoctorID": doctorProfile?.doctorID, // test user 9920
"LoginDoctorID": doctorProfile?.doctorID
},
);
}
} }

@ -328,13 +328,19 @@ class AuthenticationViewModel extends BaseViewModel {
getDeviceInfoFromFirebase() async { getDeviceInfoFromFirebase() async {
// await checkIsHuawei(); // await checkIsHuawei();
var token; var token;
var APNSToken;
_firebaseMessaging.setAutoInitEnabled(true); _firebaseMessaging.setAutoInitEnabled(true);
if (Platform.isIOS) { if (Platform.isIOS) {
_firebaseMessaging.requestPermission(); _firebaseMessaging.requestPermission();
} }
setState(ViewState.Busy); setState(ViewState.Busy);
try { try {
if (Platform.isIOS) {
APNSToken = await _firebaseMessaging.getAPNSToken();
print("APNS TOKEN: $APNSToken");
}
token = await _firebaseMessaging.getToken(); token = await _firebaseMessaging.getToken();
print("Device TOKEN: $token");
} catch (ex) { } catch (ex) {
print(ex); print(ex);
} }

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/dashboard/doctor_schedule.dart'; import 'package:doctor_app_flutter/core/model/dashboard/doctor_schedule.dart';
import 'package:doctor_app_flutter/core/model/dashboard/radiology_critical_finding_model.dart';
import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart';
import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart'; import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart';
import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart'; import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart';
@ -16,12 +17,12 @@ import 'base_view_model.dart';
class DashboardViewModel extends BaseViewModel { class DashboardViewModel extends BaseViewModel {
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;
DashboardService _dashboardService = locator<DashboardService>(); DashboardService _dashboardService = locator<DashboardService>();
SpecialClinicsService _specialClinicsService = SpecialClinicsService _specialClinicsService = locator<SpecialClinicsService>();
locator<SpecialClinicsService>();
DoctorReplyService _doctorReplyService = locator<DoctorReplyService>(); DoctorReplyService _doctorReplyService = locator<DoctorReplyService>();
List<DashboardModel> get dashboardItemsList => List<DashboardModel> get dashboardItemsList => _dashboardService.dashboardItemsList;
_dashboardService.dashboardItemsList;
RadiologyCriticalFindingModel get radiologyCriticalFindingModel => _dashboardService.radiologyCriticalFindingModel;
bool get hasVirtualClinic => _dashboardService.hasVirtualClinic; bool get hasVirtualClinic => _dashboardService.hasVirtualClinic;
@ -29,10 +30,9 @@ class DashboardViewModel extends BaseViewModel {
int get notRepliedCount => _doctorReplyService.notRepliedCount; int get notRepliedCount => _doctorReplyService.notRepliedCount;
List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList => List<GetSpecialClinicalCareListResponseModel> get specialClinicalCareList => _specialClinicsService.specialClinicalCareList;
_specialClinicsService.specialClinicalCareList;
Future startHomeScreenServices(ProjectViewModel projectsProvider, Future startHomeScreenServices(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async {
AuthenticationViewModel authProvider) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await getDoctorProfile(isGetProfile: true); await getDoctorProfile(isGetProfile: true);
@ -41,6 +41,7 @@ class DashboardViewModel extends BaseViewModel {
_dashboardService.getDashboard(), _dashboardService.getDashboard(),
_dashboardService.checkDoctorHasLiveCare(), _dashboardService.checkDoctorHasLiveCare(),
_specialClinicsService.getSpecialClinicalCareList(), _specialClinicsService.getSpecialClinicalCareList(),
_dashboardService.checkDoctorHasRadiologyFindings()
]); ]);
if (_dashboardService.hasError) { if (_dashboardService.hasError) {
@ -53,14 +54,13 @@ class DashboardViewModel extends BaseViewModel {
} }
Future setFirebaseNotification(AuthenticationViewModel authProvider) async { Future setFirebaseNotification(AuthenticationViewModel authProvider) async {
_firebaseMessaging.requestPermission( _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true);
sound: true, badge: true, alert: true, provisional: true);
_firebaseMessaging.getToken().then((String token) async { _firebaseMessaging.getToken().then((String token) async {
if (token != '') { if (token != '') {
// DEVICE_TOKEN = token; // DEVICE_TOKEN = token;
///TODO Elham* return it back ///TODO Elham* return it back
authProvider.insertDeviceImei(token); authProvider.insertDeviceImei(token);
} }
}); });
} }
@ -75,6 +75,10 @@ class DashboardViewModel extends BaseViewModel {
await _dashboardService.checkDoctorHasLiveCare(); await _dashboardService.checkDoctorHasLiveCare();
} }
Future acknowledgeRadiologyCriticalFinding(String invoiceNo, String invoiceLineItemNo) async {
await _dashboardService.acknowledgeDoctorHasRadiologyFindings(invoiceNo, invoiceLineItemNo);
}
Future getSpecialClinicalCareList() async { Future getSpecialClinicalCareList() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _specialClinicsService.getSpecialClinicalCareList(); await _specialClinicsService.getSpecialClinicalCareList();
@ -85,8 +89,7 @@ class DashboardViewModel extends BaseViewModel {
// setState(ViewState.Idle); // setState(ViewState.Idle);
} }
Future changeClinic( Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async {
int clinicId, AuthenticationViewModel authProvider) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await getDoctorProfile(); await getDoctorProfile();
ClinicModel clinicModel = ClinicModel( ClinicModel clinicModel = ClinicModel(
@ -130,6 +133,4 @@ class DashboardViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
} }

@ -71,8 +71,14 @@ class _HomeScreenState extends State<HomeScreen> {
return BaseView<DashboardViewModel>( return BaseView<DashboardViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
model.startHomeScreenServices( model.startHomeScreenServices(projectsProvider, authenticationViewModel).then((value) {
projectsProvider, authenticationViewModel); if (model.radiologyCriticalFindingModel != null) {
print("onModelReady radiologyCriticalFindingModel!!!");
showRadiologyFindingDialog(model);
} else {
print("onModelReady radiologyCriticalFindingModel EMPTYYYY!!!");
}
});
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
@ -87,12 +93,9 @@ class _HomeScreenState extends State<HomeScreen> {
//TODO Elham* make it componet //TODO Elham* make it componet
Container( Container(
width: 40, width: 40,
margin: EdgeInsets.only( margin: EdgeInsets.only(left: projectsProvider.isArabic ? 0 : 32, right: projectsProvider.isArabic ? 23 : 0),
left: projectsProvider.isArabic ? 0 : 32,
right: projectsProvider.isArabic ? 23 : 0),
child: IconButton( child: IconButton(
icon: SvgPicture.asset('assets/images/svgs/menu.svg', icon: SvgPicture.asset('assets/images/svgs/menu.svg', height: 25, width: 10),
height: 25, width: 10),
iconSize: 15, iconSize: 15,
color: Colors.black, color: Colors.black,
onPressed: () => Scaffold.of(context).openDrawer(), onPressed: () => Scaffold.of(context).openDrawer(),
@ -105,118 +108,69 @@ class _HomeScreenState extends State<HomeScreen> {
children: [ children: [
Container( Container(
width: MediaQuery.of(context).size.width * .6, width: MediaQuery.of(context).size.width * .6,
child: projectsProvider.doctorClinicsList.length > child: projectsProvider.doctorClinicsList.length > 0
0
? Stack( ? Stack(
children: [ children: [
DropdownButtonHideUnderline( DropdownButtonHideUnderline(
child: DropdownButton( child: DropdownButton(
dropdownColor: Colors.white, dropdownColor: Colors.white,
iconEnabledColor: iconEnabledColor: AppGlobal.appTextColor,
AppGlobal.appTextColor,
icon: Icon(Icons.keyboard_arrow_down), icon: Icon(Icons.keyboard_arrow_down),
isExpanded: true, isExpanded: true,
value: clinicId == null value: clinicId == null ? projectsProvider.doctorClinicsList[0].clinicID : clinicId,
? projectsProvider
.doctorClinicsList[0].clinicID
: clinicId,
iconSize: 25, iconSize: 25,
elevation: 16, elevation: 16,
selectedItemBuilder: selectedItemBuilder: (BuildContext context) {
(BuildContext context) { return projectsProvider.doctorClinicsList.map((item) {
return projectsProvider
.doctorClinicsList
.map((item) {
return Row( return Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.end,
MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
Column( Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment
.center,
children: [ children: [
Container( Container(
padding: padding: EdgeInsets.all(0),
EdgeInsets.all(0), margin: EdgeInsets.all(2),
margin: decoration: new BoxDecoration(
EdgeInsets.all(2), color: AppGlobal.appRedColor,
decoration: borderRadius: BorderRadius.circular(20),
new BoxDecoration(
color: AppGlobal
.appRedColor,
borderRadius:
BorderRadius
.circular(
20),
), ),
constraints: constraints: BoxConstraints(
BoxConstraints(
minWidth: 20, minWidth: 20,
minHeight: 20, minHeight: 20,
), ),
child: Center( child: Center(
child: AppText( child: AppText(
projectsProvider projectsProvider.doctorClinicsList.length.toString(),
.doctorClinicsList color: Colors.white,
.length letterSpacing: -0.72,
.toString(), fontWeight: FontWeight.w600,
color: fontSize: projectsProvider.isArabic ? 10 : 12,
Colors.white, textAlign: TextAlign.center,
letterSpacing:
-0.72,
fontWeight:
FontWeight
.w600,
fontSize:
projectsProvider
.isArabic
? 10
: 12,
textAlign:
TextAlign
.center,
), ),
)), )),
], ],
), ),
AppText( AppText(Utils.convertToTitleCase(item.clinicName),
Utils fontSize: 14, letterSpacing: -0.96, color: AppGlobal.appTextColor, fontWeight: FontWeight.bold, textAlign: TextAlign.end),
.convertToTitleCase(
item.clinicName),
fontSize: 14,
letterSpacing: -0.96,
color: AppGlobal
.appTextColor,
fontWeight:
FontWeight.bold,
textAlign: TextAlign.end),
], ],
); );
}).toList(); }).toList();
}, },
onChanged: (newValue) async { onChanged: (newValue) async {
clinicId = newValue; clinicId = newValue;
GifLoaderDialogUtils.showMyDialog( GifLoaderDialogUtils.showMyDialog(context);
context); await model.changeClinic(newValue, authenticationViewModel);
await model.changeClinic(newValue, GifLoaderDialogUtils.hideDialog(context);
authenticationViewModel); if (model.state == ViewState.ErrorLocal) {
GifLoaderDialogUtils.hideDialog( DrAppToastMsg.showErrorToast(model.error);
context);
if (model.state ==
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
} }
}, },
items: projectsProvider items: projectsProvider.doctorClinicsList.map((item) {
.doctorClinicsList
.map((item) {
return DropdownMenuItem( return DropdownMenuItem(
child: AppText( child: AppText(
Utils.convertToTitleCase( Utils.convertToTitleCase(item.clinicName),
item.clinicName),
fontSize: 14, fontSize: 14,
letterSpacing: -0.96, letterSpacing: -0.96,
color: AppGlobal.appTextColor, color: AppGlobal.appTextColor,
@ -229,8 +183,7 @@ class _HomeScreenState extends State<HomeScreen> {
)), )),
], ],
) )
: AppText( : AppText(TranslationBase.of(context).noClinic),
TranslationBase.of(context).noClinic),
), ),
], ],
), ),
@ -260,22 +213,16 @@ class _HomeScreenState extends State<HomeScreen> {
? FractionallySizedBox( ? FractionallySizedBox(
widthFactor: 0.90, widthFactor: 0.90,
child: Container( child: Container(
child: Column( child: Column(mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[
mainAxisAlignment: SizedBox(
MainAxisAlignment.start, height: 10,
children: <Widget>[ ),
SizedBox( sliderActiveIndex == 1
height: 10, ? DashboardSliderItemWidget(model.dashboardItemsList[4])
), : sliderActiveIndex == 0
sliderActiveIndex == 1 ? DashboardSliderItemWidget(model.dashboardItemsList[3])
? DashboardSliderItemWidget( : DashboardSliderItemWidget(model.dashboardItemsList[6]),
model.dashboardItemsList[4]) ])))
: sliderActiveIndex == 0
? DashboardSliderItemWidget(
model.dashboardItemsList[3])
: DashboardSliderItemWidget(
model.dashboardItemsList[6]),
])))
: SizedBox(), : SizedBox(),
], ],
) )
@ -314,12 +261,9 @@ class _HomeScreenState extends State<HomeScreen> {
: SizeConfig.isHeightLarge : SizeConfig.isHeightLarge
? 15 ? 15
: 13), : 13),
child: ListView( child: ListView(scrollDirection: Axis.horizontal, children: [
scrollDirection: Axis.horizontal, ...homePatientsCardsWidget(model, projectsProvider),
children: [ ])),
...homePatientsCardsWidget(
model, projectsProvider),
])),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
@ -336,27 +280,28 @@ class _HomeScreenState extends State<HomeScreen> {
); );
} }
List<Widget> homePatientsCardsWidget( showRadiologyFindingDialog(DashboardViewModel model) {
DashboardViewModel model, projectsProvider) { Utils.showConfirmationDialog(context, model.radiologyCriticalFindingModel.notificationMesssage, () async {
Navigator.of(context).pop();
GifLoaderDialogUtils.showMyDialog(context);
await model.acknowledgeRadiologyCriticalFinding(model.radiologyCriticalFindingModel.invoiceNo.toString(), model.radiologyCriticalFindingModel.invoiceLineItemNo.toString());
GifLoaderDialogUtils.hideDialog(context);
}, isShowCancelButton: false);
}
List<Widget> homePatientsCardsWidget(DashboardViewModel model, projectsProvider) {
colorIndex = 0; colorIndex = 0;
List<LinearGradient> backgroundColors = List(3); List<LinearGradient> backgroundColors = List(3);
backgroundColors[0] = LinearGradient( backgroundColors[0] = LinearGradient(begin: Alignment(-1.0, -2.0), end: Alignment(1.0, 2.0), colors: [
begin: Alignment(-1.0, -2.0), AppGlobal.appRedColor,
end: Alignment(1.0, 2.0), Color(0xFFAD3B3B),
colors: [ ]); //AppGlobal.appRedColor;
AppGlobal.appRedColor, backgroundColors[1] = LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [
Color(0xFFAD3B3B),
]); //AppGlobal.appRedColor;
backgroundColors[1] =
LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [
Color(0xFFC9C9C9), Color(0xFFC9C9C9),
Color(0xFFC9C9C9), Color(0xFFC9C9C9),
]); ]);
backgroundColors[2] = LinearGradient( backgroundColors[2] = LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [Color(0xFF71787E), AppGlobal.appTextColor]);
begin: Alignment.center,
end: Alignment.center,
colors: [Color(0xFF71787E), AppGlobal.appTextColor]);
List<Color> backgroundIconColors = List(3); List<Color> backgroundIconColors = List(3);
backgroundIconColors[0] = Colors.white12; backgroundIconColors[0] = Colors.white12;
backgroundIconColors[1] = Colors.white38; backgroundIconColors[1] = Colors.white38;
@ -375,8 +320,7 @@ class _HomeScreenState extends State<HomeScreen> {
cardIcon: DoctorApp.livecare, cardIcon: DoctorApp.livecare,
textColor: textColors[colorIndex], textColor: textColors[colorIndex],
iconSize: 21, iconSize: 21,
text: text: "${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}",
"${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}",
onTap: () { onTap: () {
// TODO MOSA TEST // TODO MOSA TEST
// PatiantInformtion patient = PatiantInformtion( // PatiantInformtion patient = PatiantInformtion(
@ -411,13 +355,12 @@ class _HomeScreenState extends State<HomeScreen> {
backgroundIconColor: backgroundIconColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.qr_reader, cardIcon: DoctorApp.qr_reader,
textColor: textColors[colorIndex], textColor: textColors[colorIndex],
text: "ER sign In" , text: "ER sign In",
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: ErSignInScreen( page: ErSignInScreen(),
),
), ),
); );
}, },
@ -435,8 +378,7 @@ class _HomeScreenState extends State<HomeScreen> {
context, context,
FadePage( FadePage(
page: InPatientScreen( page: InPatientScreen(
specialClinic: model.getSpecialClinic( specialClinic: model.getSpecialClinic(clinicId ?? projectsProvider.doctorClinicsList[0].clinicID),
clinicId ?? projectsProvider.doctorClinicsList[0].clinicID),
), ),
), ),
); );
@ -469,19 +411,13 @@ class _HomeScreenState extends State<HomeScreen> {
textColor: textColors[colorIndex], textColor: textColors[colorIndex],
text: TranslationBase.of(context).myOutPatient_2lines, text: TranslationBase.of(context).myOutPatient_2lines,
onTap: () { onTap: () {
String date = AppDateUtils.convertDateToFormat( String date = AppDateUtils.convertDateToFormat(DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd');
DateTime(
DateTime.now().year, DateTime.now().month, DateTime.now().day),
'yyyy-MM-dd');
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => OutPatientsScreen( builder: (context) => OutPatientsScreen(
patientSearchRequestModel: PatientSearchRequestModel( patientSearchRequestModel: PatientSearchRequestModel(from: date, to: date, doctorID: authenticationViewModel.doctorProfile.doctorID),
from: date,
to: date,
doctorID: authenticationViewModel.doctorProfile.doctorID),
), ),
settings: RouteSettings(name: 'OutPatientsScreen'), settings: RouteSettings(name: 'OutPatientsScreen'),
)); ));
@ -541,10 +477,7 @@ class _HomeScreenState extends State<HomeScreen> {
)); ));
changeColorIndex(); changeColorIndex();
return [ return [...List.generate(patientCards.length, (index) => patientCards[index]).toList()];
...List.generate(patientCards.length, (index) => patientCards[index])
.toList()
];
} }
changeColorIndex() { changeColorIndex() {

@ -26,7 +26,7 @@ class Utils {
get currentLanguage => null; get currentLanguage => null;
static showConfirmationDialog(BuildContext context, String message, Function okFunction) { static showConfirmationDialog(BuildContext context, String message, Function okFunction, {bool isShowCancelButton = true}) {
return showDialog( return showDialog(
context: context, context: context,
barrierDismissible: false, // user must tap button! barrierDismissible: false, // user must tap button!
@ -47,14 +47,18 @@ class Utils {
fontColor: Colors.white, fontColor: Colors.white,
color: AppGlobal.appGreenColor, color: AppGlobal.appGreenColor,
), ),
AppButton( SizedBox(
onPressed: () { height: 30,
Navigator.of(context).pop();
},
title: TranslationBase.of(context).cancel,
fontColor: Colors.white,
color: Colors.red[600],
), ),
if (isShowCancelButton)
AppButton(
onPressed: () {
Navigator.of(context).pop();
},
title: TranslationBase.of(context).cancel,
fontColor: Colors.white,
color: Colors.red[600],
),
], ],
), ),
], ],

@ -15,26 +15,26 @@ class ConfirmationDialog extends StatefulWidget {
} }
class _ConfirmationDialogState extends State<ConfirmationDialog> { class _ConfirmationDialogState extends State<ConfirmationDialog> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AlertDialog( return AlertDialog(
title: Text("Alert"), title: Text("Alert"),
content: Text(widget.title), content: Text(widget.title),
actions: [ actions: [
TextButton( TextButton(
child: Text(TranslationBase.of(context).cancel), child: Text(TranslationBase.of(context).cancel),
onPressed: () { Navigator.pop(context);}, onPressed: () {
Navigator.pop(context);
},
), ),
TextButton( TextButton(
child: Text(TranslationBase.of(context).ok), child: Text(TranslationBase.of(context).ok),
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
widget.onTapGrant(); widget.onTapGrant();
}, },
) )
], ],
); );
} }
} }

Loading…
Cancel
Save