|
|
|
|
@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'
|
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_shared_pref.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/shared/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:percent_indicator/circular_percent_indicator.dart';
|
|
|
|
|
@ -26,6 +27,7 @@ import '../widgets/shared/rounded_container_widget.dart';
|
|
|
|
|
import 'doctor/doctor_reply_screen.dart';
|
|
|
|
|
import 'doctor/my_referral_patient_screen.dart';
|
|
|
|
|
import 'doctor/my_referred_patient_screen.dart';
|
|
|
|
|
|
|
|
|
|
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
|
|
|
|
Helpers helpers = Helpers();
|
|
|
|
|
|
|
|
|
|
@ -41,20 +43,21 @@ class DashboardScreen extends StatefulWidget {
|
|
|
|
|
class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
HospitalProvider hospitalProvider;
|
|
|
|
|
AuthProvider authProvider;
|
|
|
|
|
|
|
|
|
|
bool isLoading = false;
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
hospitalProvider = Provider.of(context);
|
|
|
|
|
authProvider = Provider.of(context);
|
|
|
|
|
print(authProvider.doctorsClinicList);
|
|
|
|
|
FocusScopeNode currentFocus = FocusScope.of(context);
|
|
|
|
|
|
|
|
|
|
if (!currentFocus.hasPrimaryFocus) {
|
|
|
|
|
currentFocus.unfocus();
|
|
|
|
|
}
|
|
|
|
|
return SafeArea(
|
|
|
|
|
bottom: true,
|
|
|
|
|
child: Scaffold(
|
|
|
|
|
child: AppScaffold(
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
isLoading: isLoading,
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 1.09,
|
|
|
|
|
@ -434,11 +437,8 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showCupertinoPicker(
|
|
|
|
|
{context, List<ClinicModel> actionList, decKey, onSelectFun}) {
|
|
|
|
|
showModalBottomSheet(
|
|
|
|
|
@ -487,11 +487,12 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
children: actionList
|
|
|
|
|
.map((e) => Container(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: ()=>changeClinic(e.clinicID,context),
|
|
|
|
|
onTap: () =>
|
|
|
|
|
changeClinic(e.clinicID, context),
|
|
|
|
|
child: Text(
|
|
|
|
|
e.clinicName,
|
|
|
|
|
style: TextStyle(fontSize: 15),
|
|
|
|
|
)),
|
|
|
|
|
e.clinicName,
|
|
|
|
|
style: TextStyle(fontSize: 15),
|
|
|
|
|
)),
|
|
|
|
|
))
|
|
|
|
|
.toList(),
|
|
|
|
|
))
|
|
|
|
|
@ -501,10 +502,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
changeClinic(clinicId , BuildContext context) async{
|
|
|
|
|
changeClinic(clinicId, BuildContext context) async {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
changeIsLoading(true);
|
|
|
|
|
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
|
|
|
|
DoctorProfileModel doctorProfile =
|
|
|
|
|
new DoctorProfileModel.fromJson(profile);
|
|
|
|
|
DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile);
|
|
|
|
|
ProfileReqModel docInfo = new ProfileReqModel(
|
|
|
|
|
doctorID: doctorProfile.doctorID,
|
|
|
|
|
clinicID: clinicId,
|
|
|
|
|
@ -513,16 +515,21 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
tokenID: '',
|
|
|
|
|
languageID: 2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// authProvider.getDocProfiles(docInfo)
|
|
|
|
|
authProvider.getDocProfiles(docInfo.toJson()).then((res)async {
|
|
|
|
|
sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
authProvider.getDocProfiles(docInfo.toJson()).then((res) async {
|
|
|
|
|
|
|
|
|
|
changeIsLoading(false);
|
|
|
|
|
sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]);
|
|
|
|
|
|
|
|
|
|
// changeLoadingStata(false);
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
changeIsLoading(false);
|
|
|
|
|
helpers.showErrorToast(err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
changeIsLoading(bool val) {
|
|
|
|
|
setState(() {
|
|
|
|
|
this.isLoading = val;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|