|
|
|
@ -2,26 +2,21 @@ import 'package:charts_flutter/flutter.dart' as charts;
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
import 'package:doctor_app_flutter/config/shared_pref_kay.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/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/model/PatientSearchRequestModel.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/doctor_profile_view_model.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/hospitals_view_model.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
|
|
|
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
|
|
|
|
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/models/patient/patient_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.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';
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_result_screen.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart';
|
|
|
|
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/date-utils.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
|
|
|
|
@ -35,6 +30,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/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_scaffold_widget.dart';
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_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:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
|
|
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
|
|
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
@ -43,7 +39,6 @@ import 'package:flutter_swiper/flutter_swiper.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:sticky_headers/sticky_headers/widget.dart';
|
|
|
|
import 'package:sticky_headers/sticky_headers/widget.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import '../../locator.dart';
|
|
|
|
|
|
|
|
import '../../widgets/shared/app_texts_widget.dart';
|
|
|
|
import '../../widgets/shared/app_texts_widget.dart';
|
|
|
|
import '../../widgets/shared/rounded_container_widget.dart';
|
|
|
|
import '../../widgets/shared/rounded_container_widget.dart';
|
|
|
|
import 'home_page_card.dart';
|
|
|
|
import 'home_page_card.dart';
|
|
|
|
@ -63,7 +58,6 @@ class HomeScreen extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
|
|
class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
|
|
|
|
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
|
|
|
|
DoctorProfileViewModel authProvider;
|
|
|
|
|
|
|
|
bool isLoading = false;
|
|
|
|
bool isLoading = false;
|
|
|
|
ProjectViewModel projectsProvider;
|
|
|
|
ProjectViewModel projectsProvider;
|
|
|
|
var _isInit = true;
|
|
|
|
var _isInit = true;
|
|
|
|
@ -111,7 +105,6 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
myContext = context;
|
|
|
|
myContext = context;
|
|
|
|
authProvider = Provider.of(context);
|
|
|
|
|
|
|
|
projectsProvider = Provider.of(context);
|
|
|
|
projectsProvider = Provider.of(context);
|
|
|
|
FocusScopeNode currentFocus = FocusScope.of(context);
|
|
|
|
FocusScopeNode currentFocus = FocusScope.of(context);
|
|
|
|
|
|
|
|
|
|
|
|
@ -584,7 +577,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
PatientSearchRequestModel(
|
|
|
|
PatientSearchRequestModel(
|
|
|
|
from: date,
|
|
|
|
from: date,
|
|
|
|
to: date,
|
|
|
|
to: date,
|
|
|
|
doctorID: authProvider
|
|
|
|
doctorID: authenticationViewModel
|
|
|
|
.doctorProfile
|
|
|
|
.doctorProfile
|
|
|
|
.doctorID)),
|
|
|
|
.doctorID)),
|
|
|
|
));
|
|
|
|
));
|
|
|
|
@ -811,24 +804,16 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
changeClinic(clinicId, BuildContext context, model) async {
|
|
|
|
changeClinic(clinicId, BuildContext context, model) async {
|
|
|
|
// Navigator.pop(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
changeIsLoading(true);
|
|
|
|
DoctorProfileModel doctorProfile = authenticationViewModel.doctorProfile;
|
|
|
|
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
|
|
|
|
|
|
|
DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile);
|
|
|
|
ClinicModel clinic = ClinicModel(clinicID:clinicId, doctorID: doctorProfile.doctorID,projectID: doctorProfile.projectID, );
|
|
|
|
ProfileReqModel docInfo = new ProfileReqModel(
|
|
|
|
await authenticationViewModel.getDoctorProfileBasedOnClinic(clinic);
|
|
|
|
doctorID: doctorProfile.doctorID,
|
|
|
|
if(authenticationViewModel.state == ViewState.ErrorLocal) {
|
|
|
|
clinicID: clinicId,
|
|
|
|
Helpers.showErrorToast(authenticationViewModel.error);
|
|
|
|
license: true,
|
|
|
|
|
|
|
|
projectID: doctorProfile.projectID,
|
|
|
|
}
|
|
|
|
tokenID: '',
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
languageID: 2);
|
|
|
|
|
|
|
|
authProvider.getDocProfiles(docInfo.toJson()).then((res) async {
|
|
|
|
|
|
|
|
changeIsLoading(false);
|
|
|
|
|
|
|
|
sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]);
|
|
|
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
|
|
|
changeIsLoading(false);
|
|
|
|
|
|
|
|
Helpers.showErrorToast(err);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
changeIsLoading(bool val) {
|
|
|
|
changeIsLoading(bool val) {
|
|
|
|
|