dashboard

merge-requests/197/head
Sultan Khan 4 years ago
parent d6c35f9df0
commit ac747e7519

@ -77,6 +77,7 @@ const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles';
const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin';
const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall';
const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge';
const GET_DASHBOARD = 'DoctorApplication.svc/REST/GetDoctorDashboardKPI';
var selectedPatientType = 1; var selectedPatientType = 1;

@ -8,3 +8,4 @@ final APP_Language = 'language';
final DOCTOR_PROFILE = 'doctorProfile'; final DOCTOR_PROFILE = 'doctorProfile';
final LIVE_CARE_PATIENT = 'livecare-patient-profile'; final LIVE_CARE_PATIENT = 'livecare-patient-profile';
final LOGGED_IN_USER = 'loggedUser'; final LOGGED_IN_USER = 'loggedUser';
final DASHBOARD_DATA = 'dashboard-data';

@ -17,12 +17,11 @@ class AuthProvider with ChangeNotifier {
bool isLoading = true; bool isLoading = true;
DoctorProfileModel doctorProfile; DoctorProfileModel doctorProfile;
BaseAppClient baseAppClient = BaseAppClient(); BaseAppClient baseAppClient = BaseAppClient();
setDoctorProfile(DoctorProfileModel profileModel){ setDoctorProfile(DoctorProfileModel profileModel) {
doctorProfile = profileModel; doctorProfile = profileModel;
notifyListeners(); notifyListeners();
} }
AuthProvider() { AuthProvider() {
getUserAuthentication(); getUserAuthentication();
} }
@ -154,7 +153,8 @@ class AuthProvider with ChangeNotifier {
await baseAppClient.post(GET_DOC_PROFILES, await baseAppClient.post(GET_DOC_PROFILES,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
doctorProfile = DoctorProfileModel.fromJson(response['DoctorProfileList'][0]); doctorProfile =
DoctorProfileModel.fromJson(response['DoctorProfileList'][0]);
selectedClinicName = selectedClinicName =
response['DoctorProfileList'][0]['ClinicDescription']; response['DoctorProfileList'][0]['ClinicDescription'];
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -167,4 +167,21 @@ class AuthProvider with ChangeNotifier {
throw error; throw error;
} }
} }
Future<dynamic> getDashboard(docInfo) async {
try {
dynamic localRes;
await baseAppClient.post(GET_DASHBOARD,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: {"DoctorID": docInfo.doctorID});
notifyListeners();
return Future.value(localRes);
} catch (error) {
print(error);
throw error;
}
}
} }

@ -363,7 +363,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
"IsSilentLogIN": false "IsSilentLogIN": false
}; };
authProv.memberCheckActivationCodeNew(model).then((res) async{ authProv.memberCheckActivationCodeNew(model).then((res) async {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
sharedPref.setString(TOKEN, res['AuthenticationTokenID']); sharedPref.setString(TOKEN, res['AuthenticationTokenID']);
if (res['List_DoctorProfile'] != null) { if (res['List_DoctorProfile'] != null) {
@ -396,10 +396,16 @@ class _VerifyAccountState extends State<VerifyAccount> {
Map<String, dynamic> profile, Function changeLoadingStata) { Map<String, dynamic> profile, Function changeLoadingStata) {
var doctor = DoctorProfileModel.fromJson(profile); var doctor = DoctorProfileModel.fromJson(profile);
authProv.setDoctorProfile(doctor); authProv.setDoctorProfile(doctor);
this.getDashboard(doctor, changeLoadingStata);
}
getDashboard(doctor, Function changeLoadingStata) {
// authProv.getDashboard(doctor).then((value) {
// print(value);
changeLoadingStata(false); changeLoadingStata(false);
sharedPref.setObj(DOCTOR_PROFILE, profile); // sharedPref.setObj(DASHBOARD_DATA, value);
Navigator.of(context).pushReplacementNamed(HOME); Navigator.of(context).pushReplacementNamed(HOME);
// });
} }
Future<dynamic> _asyncSimpleDialog( Future<dynamic> _asyncSimpleDialog(

@ -14,7 +14,7 @@ description: A new Flutter project.
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: ">=2.6.0 <3.0.0" sdk: ">=2.8.0 <3.0.0"
dependencies: dependencies:
flutter: flutter:
@ -50,7 +50,7 @@ dependencies:
cupertino_icons: ^0.1.2 cupertino_icons: ^0.1.2
# SVG # SVG
#flutter_svg: ^0.17.4 #flutter_svg: ^0.17.4
percent_indicator: "^2.1.1" percent_indicator: ^2.1.1
#Dependency Injection #Dependency Injection
get_it: ^4.0.2 get_it: ^4.0.2
@ -80,7 +80,7 @@ flutter:
assets: assets:
- assets/images/ - assets/images/
- assets/images/dashboard/ - assets/images/dashboard/
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see # An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware. # https://flutter.dev/assets-and-images/#resolution-aware.

Loading…
Cancel
Save