|
|
|
|
@ -125,117 +125,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,
|
|
|
|
|
@ -248,8 +200,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: AppText(
|
|
|
|
|
TranslationBase.of(context).noClinic),
|
|
|
|
|
: AppText(TranslationBase.of(context).noClinic),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -279,22 +230,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(),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
@ -333,12 +278,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,
|
|
|
|
|
),
|
|
|
|
|
@ -469,25 +411,29 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
));
|
|
|
|
|
changeColorIndex();
|
|
|
|
|
|
|
|
|
|
patientCards.add(HomePatientCard(
|
|
|
|
|
gradient: backgroundColors[colorIndex],
|
|
|
|
|
backgroundIconColor: backgroundIconColors[colorIndex],
|
|
|
|
|
cardIcon: DoctorApp.inpatient,
|
|
|
|
|
textColor: textColors[colorIndex],
|
|
|
|
|
text: TranslationBase.of(context).myInPatient,
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: InPatientScreen(
|
|
|
|
|
specialClinic: model.getSpecialClinic(
|
|
|
|
|
if (!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,
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
FadePage(
|
|
|
|
|
page: InPatientScreen(
|
|
|
|
|
specialClinic: model.getSpecialClinic(
|
|
|
|
|
clinicId ?? projectsProvider.doctorClinicsList[0].clinicID),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
));
|
|
|
|
|
changeColorIndex();
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
));
|
|
|
|
|
changeColorIndex();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (model.isInfectiousDiseaseConsultant) {
|
|
|
|
|
patientCards.add(HomePatientCard(
|
|
|
|
|
|