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 END_CALL = 'LiveCareApi/DoctorApp/EndCall';
const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge';
const GET_DASHBOARD = 'DoctorApplication.svc/REST/GetDoctorDashboardKPI';
var selectedPatientType = 1;

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

@ -17,17 +17,16 @@ class AuthProvider with ChangeNotifier {
bool isLoading = true;
DoctorProfileModel doctorProfile;
BaseAppClient baseAppClient = BaseAppClient();
setDoctorProfile(DoctorProfileModel profileModel){
setDoctorProfile(DoctorProfileModel profileModel) {
doctorProfile = profileModel;
notifyListeners();
}
AuthProvider() {
getUserAuthentication();
}
getUserAuthentication() async {
getUserAuthentication() async {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) {
doctorProfile = new DoctorProfileModel.fromJson(profile);
@ -154,7 +153,8 @@ class AuthProvider with ChangeNotifier {
await baseAppClient.post(GET_DOC_PROFILES,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
doctorProfile = DoctorProfileModel.fromJson(response['DoctorProfileList'][0]);
doctorProfile =
DoctorProfileModel.fromJson(response['DoctorProfileList'][0]);
selectedClinicName =
response['DoctorProfileList'][0]['ClinicDescription'];
}, onFailure: (String error, int statusCode) {
@ -167,4 +167,21 @@ class AuthProvider with ChangeNotifier {
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
};
authProv.memberCheckActivationCodeNew(model).then((res) async{
authProv.memberCheckActivationCodeNew(model).then((res) async {
if (res['MessageStatus'] == 1) {
sharedPref.setString(TOKEN, res['AuthenticationTokenID']);
if (res['List_DoctorProfile'] != null) {
@ -394,12 +394,18 @@ class _VerifyAccountState extends State<VerifyAccount> {
*/
loginProcessCompleted(
Map<String, dynamic> profile, Function changeLoadingStata) {
var doctor = DoctorProfileModel.fromJson(profile);
authProv.setDoctorProfile(doctor);
var doctor = DoctorProfileModel.fromJson(profile);
authProv.setDoctorProfile(doctor);
this.getDashboard(doctor, changeLoadingStata);
}
getDashboard(doctor, Function changeLoadingStata) {
// authProv.getDashboard(doctor).then((value) {
// print(value);
changeLoadingStata(false);
sharedPref.setObj(DOCTOR_PROFILE, profile);
// sharedPref.setObj(DASHBOARD_DATA, value);
Navigator.of(context).pushReplacementNamed(HOME);
// });
}
Future<dynamic> _asyncSimpleDialog(

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

Loading…
Cancel
Save