|
|
|
|
@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/patient_type.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
|
|
|
|
|
@ -14,6 +15,7 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/DischargedPatientPage.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart';
|
|
|
|
|
@ -24,6 +26,7 @@ import 'package:doctor_app_flutter/screens/patients/patient_search/patient_searc
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/dashboard/activity_button.dart';
|
|
|
|
|
@ -34,6 +37,7 @@ import 'package:doctor_app_flutter/widgets/dashboard/swiper_rounded_pagination.d
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.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/loader/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
|
|
|
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
@ -47,7 +51,6 @@ import '../../widgets/shared/rounded_container_widget.dart';
|
|
|
|
|
import 'home_page_card.dart';
|
|
|
|
|
|
|
|
|
|
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
|
|
|
|
Helpers helpers = Helpers();
|
|
|
|
|
|
|
|
|
|
class HomeScreen extends StatefulWidget {
|
|
|
|
|
HomeScreen({Key key, this.title}) : super(key: key);
|
|
|
|
|
@ -72,7 +75,6 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
var clinicName = [];
|
|
|
|
|
int sliderActiveIndex = 0;
|
|
|
|
|
var clinicId;
|
|
|
|
|
var _patientSearchFormValues;
|
|
|
|
|
|
|
|
|
|
void didChangeDependencies() async {
|
|
|
|
|
super.didChangeDependencies();
|
|
|
|
|
@ -105,6 +107,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BuildContext myContext;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
myContext = context;
|
|
|
|
|
@ -143,7 +146,6 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * .6,
|
|
|
|
|
// // height: 100,
|
|
|
|
|
child: projectsProvider.doctorClinicsList.length >
|
|
|
|
|
0
|
|
|
|
|
? Stack(
|
|
|
|
|
@ -210,10 +212,15 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
);
|
|
|
|
|
}).toList();
|
|
|
|
|
},
|
|
|
|
|
onChanged: (newValue) {
|
|
|
|
|
onChanged: (newValue) async {
|
|
|
|
|
clinicId = newValue;
|
|
|
|
|
changeClinic(
|
|
|
|
|
newValue, context, model);
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(
|
|
|
|
|
context);
|
|
|
|
|
await model.changeClinic(newValue, authProvider);
|
|
|
|
|
GifLoaderDialogUtils
|
|
|
|
|
.hideDialog(context);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
DrAppToastMsg.showErrorToast(model.error);}
|
|
|
|
|
},
|
|
|
|
|
items: projectsProvider
|
|
|
|
|
.doctorClinicsList
|
|
|
|
|
@ -309,111 +316,13 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
sliderActiveIndex == 1
|
|
|
|
|
? Column(
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
model.dashboardItemsList[3]
|
|
|
|
|
.kPIName,
|
|
|
|
|
fontSize:
|
|
|
|
|
SizeConfig.textMultiplier *
|
|
|
|
|
2.2,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
new Container(
|
|
|
|
|
height: 130,
|
|
|
|
|
child: new ListView(
|
|
|
|
|
scrollDirection:
|
|
|
|
|
Axis.horizontal,
|
|
|
|
|
children: new List.generate(
|
|
|
|
|
model
|
|
|
|
|
.dashboardItemsList[3]
|
|
|
|
|
.summaryoptions
|
|
|
|
|
.length, (int index) {
|
|
|
|
|
return GetActivityButton(model
|
|
|
|
|
.dashboardItemsList[3]
|
|
|
|
|
.summaryoptions[index]);
|
|
|
|
|
})))
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
? DashboardSliderItemWidget(
|
|
|
|
|
model.dashboardItemsList[3])
|
|
|
|
|
: sliderActiveIndex == 0
|
|
|
|
|
? Column(
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
model.dashboardItemsList[6]
|
|
|
|
|
.kPIName,
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
.textMultiplier *
|
|
|
|
|
2.2,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
new Container(
|
|
|
|
|
height: 130,
|
|
|
|
|
child: new ListView(
|
|
|
|
|
scrollDirection: Axis
|
|
|
|
|
.horizontal,
|
|
|
|
|
children: new List
|
|
|
|
|
.generate(
|
|
|
|
|
model
|
|
|
|
|
.dashboardItemsList[
|
|
|
|
|
6]
|
|
|
|
|
.summaryoptions
|
|
|
|
|
.length,
|
|
|
|
|
(int index) {
|
|
|
|
|
return GetActivityButton(model
|
|
|
|
|
.dashboardItemsList[
|
|
|
|
|
6]
|
|
|
|
|
.summaryoptions[index]);
|
|
|
|
|
})))
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppText(
|
|
|
|
|
model.dashboardItemsList[4]
|
|
|
|
|
.kPIName,
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
.textMultiplier *
|
|
|
|
|
2.2,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
new Container(
|
|
|
|
|
height: 130,
|
|
|
|
|
child: new ListView(
|
|
|
|
|
scrollDirection: Axis
|
|
|
|
|
.horizontal,
|
|
|
|
|
children: new List
|
|
|
|
|
.generate(
|
|
|
|
|
model
|
|
|
|
|
.dashboardItemsList[
|
|
|
|
|
4]
|
|
|
|
|
.summaryoptions
|
|
|
|
|
.length,
|
|
|
|
|
(int index) {
|
|
|
|
|
return GetActivityButton(model
|
|
|
|
|
.dashboardItemsList[
|
|
|
|
|
4]
|
|
|
|
|
.summaryoptions[index]);
|
|
|
|
|
})))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
? DashboardSliderItemWidget(
|
|
|
|
|
model.dashboardItemsList[6])
|
|
|
|
|
: DashboardSliderItemWidget(
|
|
|
|
|
model.dashboardItemsList[4]),
|
|
|
|
|
])))
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
FractionallySizedBox(
|
|
|
|
|
@ -810,7 +719,6 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
changeClinic(clinicId, BuildContext context, model) async {
|
|
|
|
|
// Navigator.pop(context);
|
|
|
|
|
changeIsLoading(true);
|
|
|
|
|
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
|
|
|
|
DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile);
|
|
|
|
|
@ -960,31 +868,4 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
])),
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getRequestHeader(isInpatient) {
|
|
|
|
|
_patientSearchFormValues = PatientModel(
|
|
|
|
|
FirstName: "0",
|
|
|
|
|
MiddleName: "0",
|
|
|
|
|
LastName: "0",
|
|
|
|
|
PatientMobileNumber: "0",
|
|
|
|
|
PatientIdentificationID: "0",
|
|
|
|
|
PatientID: 0,
|
|
|
|
|
From: isInpatient == true
|
|
|
|
|
? '0'
|
|
|
|
|
: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd')
|
|
|
|
|
.toString(),
|
|
|
|
|
To: isInpatient == true
|
|
|
|
|
? '0'
|
|
|
|
|
: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd')
|
|
|
|
|
.toString(),
|
|
|
|
|
LanguageID: 2,
|
|
|
|
|
stamp: "2020-03-02T13:56:39.170Z",
|
|
|
|
|
IPAdress: "11.11.11.11",
|
|
|
|
|
VersionID: 1.2,
|
|
|
|
|
Channel: 9,
|
|
|
|
|
TokenID: "2Fi7HoIHB0eDyekVa6tCJg==",
|
|
|
|
|
SessionID: "5G0yXn0Jnq",
|
|
|
|
|
IsLoginForDoctorApp: true,
|
|
|
|
|
PatientOutSA: false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|