|
|
|
|
@ -71,8 +71,14 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
|
|
|
|
|
return BaseView<DashboardViewModel>(
|
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
model.startHomeScreenServices(
|
|
|
|
|
projectsProvider, authenticationViewModel);
|
|
|
|
|
model.startHomeScreenServices(projectsProvider, authenticationViewModel).then((value) {
|
|
|
|
|
if (model.radiologyCriticalFindingModel != null) {
|
|
|
|
|
print("onModelReady radiologyCriticalFindingModel!!!");
|
|
|
|
|
showRadiologyFindingDialog(model);
|
|
|
|
|
} else {
|
|
|
|
|
print("onModelReady radiologyCriticalFindingModel EMPTYYYY!!!");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
@ -87,12 +93,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(),
|
|
|
|
|
@ -105,118 +108,69 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * .6,
|
|
|
|
|
child: projectsProvider.doctorClinicsList.length >
|
|
|
|
|
0
|
|
|
|
|
child: projectsProvider.doctorClinicsList.length > 0
|
|
|
|
|
? Stack(
|
|
|
|
|
children: [
|
|
|
|
|
DropdownButtonHideUnderline(
|
|
|
|
|
child: DropdownButton(
|
|
|
|
|
dropdownColor: Colors.white,
|
|
|
|
|
iconEnabledColor:
|
|
|
|
|
AppGlobal.appTextColor,
|
|
|
|
|
iconEnabledColor: AppGlobal.appTextColor,
|
|
|
|
|
icon: Icon(Icons.keyboard_arrow_down),
|
|
|
|
|
isExpanded: true,
|
|
|
|
|
value: clinicId == null
|
|
|
|
|
? projectsProvider
|
|
|
|
|
.doctorClinicsList[0].clinicID
|
|
|
|
|
: clinicId,
|
|
|
|
|
value: clinicId == null ? projectsProvider.doctorClinicsList[0].clinicID : clinicId,
|
|
|
|
|
iconSize: 25,
|
|
|
|
|
elevation: 16,
|
|
|
|
|
selectedItemBuilder:
|
|
|
|
|
(BuildContext context) {
|
|
|
|
|
return projectsProvider
|
|
|
|
|
.doctorClinicsList
|
|
|
|
|
.map((item) {
|
|
|
|
|
selectedItemBuilder: (BuildContext context) {
|
|
|
|
|
return projectsProvider.doctorClinicsList.map((item) {
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.end,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment
|
|
|
|
|
.center,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.all(0),
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.all(2),
|
|
|
|
|
decoration:
|
|
|
|
|
new BoxDecoration(
|
|
|
|
|
color: AppGlobal
|
|
|
|
|
.appRedColor,
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius
|
|
|
|
|
.circular(
|
|
|
|
|
20),
|
|
|
|
|
padding: EdgeInsets.all(0),
|
|
|
|
|
margin: EdgeInsets.all(2),
|
|
|
|
|
decoration: new BoxDecoration(
|
|
|
|
|
color: AppGlobal.appRedColor,
|
|
|
|
|
borderRadius: BorderRadius.circular(20),
|
|
|
|
|
),
|
|
|
|
|
constraints:
|
|
|
|
|
BoxConstraints(
|
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
|
minWidth: 20,
|
|
|
|
|
minHeight: 20,
|
|
|
|
|
),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: AppText(
|
|
|
|
|
projectsProvider
|
|
|
|
|
.doctorClinicsList
|
|
|
|
|
.length
|
|
|
|
|
.toString(),
|
|
|
|
|
color:
|
|
|
|
|
Colors.white,
|
|
|
|
|
letterSpacing:
|
|
|
|
|
-0.72,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight
|
|
|
|
|
.w600,
|
|
|
|
|
fontSize:
|
|
|
|
|
projectsProvider
|
|
|
|
|
.isArabic
|
|
|
|
|
? 10
|
|
|
|
|
: 12,
|
|
|
|
|
textAlign:
|
|
|
|
|
TextAlign
|
|
|
|
|
.center,
|
|
|
|
|
projectsProvider.doctorClinicsList.length.toString(),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
letterSpacing: -0.72,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: projectsProvider.isArabic ? 10 : 12,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
Utils
|
|
|
|
|
.convertToTitleCase(
|
|
|
|
|
item.clinicName),
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
letterSpacing: -0.96,
|
|
|
|
|
color: AppGlobal
|
|
|
|
|
.appTextColor,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight.bold,
|
|
|
|
|
textAlign: TextAlign.end),
|
|
|
|
|
AppText(Utils.convertToTitleCase(item.clinicName),
|
|
|
|
|
fontSize: 14, letterSpacing: -0.96, color: AppGlobal.appTextColor, fontWeight: FontWeight.bold, textAlign: TextAlign.end),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}).toList();
|
|
|
|
|
},
|
|
|
|
|
onChanged: (newValue) async {
|
|
|
|
|
clinicId = newValue;
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(
|
|
|
|
|
context);
|
|
|
|
|
await model.changeClinic(newValue,
|
|
|
|
|
authenticationViewModel);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(
|
|
|
|
|
context);
|
|
|
|
|
if (model.state ==
|
|
|
|
|
ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(
|
|
|
|
|
model.error);
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await model.changeClinic(newValue, authenticationViewModel);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(model.error);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
items: projectsProvider
|
|
|
|
|
.doctorClinicsList
|
|
|
|
|
.map((item) {
|
|
|
|
|
items: projectsProvider.doctorClinicsList.map((item) {
|
|
|
|
|
return DropdownMenuItem(
|
|
|
|
|
child: AppText(
|
|
|
|
|
Utils.convertToTitleCase(
|
|
|
|
|
item.clinicName),
|
|
|
|
|
Utils.convertToTitleCase(item.clinicName),
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
letterSpacing: -0.96,
|
|
|
|
|
color: AppGlobal.appTextColor,
|
|
|
|
|
@ -229,8 +183,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: AppText(
|
|
|
|
|
TranslationBase.of(context).noClinic),
|
|
|
|
|
: AppText(TranslationBase.of(context).noClinic),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -260,22 +213,16 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
? FractionallySizedBox(
|
|
|
|
|
widthFactor: 0.90,
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
sliderActiveIndex == 1
|
|
|
|
|
? DashboardSliderItemWidget(
|
|
|
|
|
model.dashboardItemsList[4])
|
|
|
|
|
: sliderActiveIndex == 0
|
|
|
|
|
? DashboardSliderItemWidget(
|
|
|
|
|
model.dashboardItemsList[3])
|
|
|
|
|
: DashboardSliderItemWidget(
|
|
|
|
|
model.dashboardItemsList[6]),
|
|
|
|
|
])))
|
|
|
|
|
child: Column(mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
sliderActiveIndex == 1
|
|
|
|
|
? DashboardSliderItemWidget(model.dashboardItemsList[4])
|
|
|
|
|
: sliderActiveIndex == 0
|
|
|
|
|
? DashboardSliderItemWidget(model.dashboardItemsList[3])
|
|
|
|
|
: DashboardSliderItemWidget(model.dashboardItemsList[6]),
|
|
|
|
|
])))
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
@ -314,12 +261,9 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
: SizeConfig.isHeightLarge
|
|
|
|
|
? 15
|
|
|
|
|
: 13),
|
|
|
|
|
child: ListView(
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
children: [
|
|
|
|
|
...homePatientsCardsWidget(
|
|
|
|
|
model, projectsProvider),
|
|
|
|
|
])),
|
|
|
|
|
child: ListView(scrollDirection: Axis.horizontal, children: [
|
|
|
|
|
...homePatientsCardsWidget(model, projectsProvider),
|
|
|
|
|
])),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 20,
|
|
|
|
|
),
|
|
|
|
|
@ -336,27 +280,28 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Widget> homePatientsCardsWidget(
|
|
|
|
|
DashboardViewModel model, projectsProvider) {
|
|
|
|
|
showRadiologyFindingDialog(DashboardViewModel model) {
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
List<LinearGradient> backgroundColors = List(3);
|
|
|
|
|
backgroundColors[0] = LinearGradient(
|
|
|
|
|
begin: Alignment(-1.0, -2.0),
|
|
|
|
|
end: Alignment(1.0, 2.0),
|
|
|
|
|
colors: [
|
|
|
|
|
AppGlobal.appRedColor,
|
|
|
|
|
Color(0xFFAD3B3B),
|
|
|
|
|
]); //AppGlobal.appRedColor;
|
|
|
|
|
backgroundColors[1] =
|
|
|
|
|
LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [
|
|
|
|
|
backgroundColors[0] = LinearGradient(begin: Alignment(-1.0, -2.0), end: Alignment(1.0, 2.0), colors: [
|
|
|
|
|
AppGlobal.appRedColor,
|
|
|
|
|
Color(0xFFAD3B3B),
|
|
|
|
|
]); //AppGlobal.appRedColor;
|
|
|
|
|
backgroundColors[1] = LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [
|
|
|
|
|
Color(0xFFC9C9C9),
|
|
|
|
|
Color(0xFFC9C9C9),
|
|
|
|
|
]);
|
|
|
|
|
backgroundColors[2] = LinearGradient(
|
|
|
|
|
begin: Alignment.center,
|
|
|
|
|
end: Alignment.center,
|
|
|
|
|
colors: [Color(0xFF71787E), AppGlobal.appTextColor]);
|
|
|
|
|
backgroundColors[2] = LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [Color(0xFF71787E), AppGlobal.appTextColor]);
|
|
|
|
|
List<Color> backgroundIconColors = List(3);
|
|
|
|
|
backgroundIconColors[0] = Colors.white12;
|
|
|
|
|
backgroundIconColors[1] = Colors.white38;
|
|
|
|
|
@ -375,8 +320,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(
|
|
|
|
|
@ -411,13 +355,12 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
backgroundIconColor: backgroundIconColors[colorIndex],
|
|
|
|
|
cardIcon: DoctorApp.qr_reader,
|
|
|
|
|
textColor: textColors[colorIndex],
|
|
|
|
|
text: "ER sign In" ,
|
|
|
|
|
text: "ER sign In",
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: ErSignInScreen(
|
|
|
|
|
),
|
|
|
|
|
page: ErSignInScreen(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
@ -435,8 +378,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: InPatientScreen(
|
|
|
|
|
specialClinic: model.getSpecialClinic(
|
|
|
|
|
clinicId ?? projectsProvider.doctorClinicsList[0].clinicID),
|
|
|
|
|
specialClinic: model.getSpecialClinic(clinicId ?? projectsProvider.doctorClinicsList[0].clinicID),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
@ -469,19 +411,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'),
|
|
|
|
|
));
|
|
|
|
|
@ -541,10 +477,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() {
|
|
|
|
|
|