From aff8f87a2ffc5f075ab9222c7c85fac80c9f95bb Mon Sep 17 00:00:00 2001 From: Mohammad ALjammal Date: Thu, 18 Jun 2020 09:08:27 +0300 Subject: [PATCH] fix merge issues --- lib/config/config.dart | 4 +- lib/screens/dashboard_screen.dart | 95 +++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 2 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index af7633f3..d3f1e95d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -2,8 +2,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -//const BASE_URL = 'https://hmgwebservices.com/Services/'; -const BASE_URL = 'https://uat.hmgwebservices.com/Services/'; +const BASE_URL = 'https://hmgwebservices.com/Services/'; +//const BASE_URL = 'https://uat.hmgwebservices.com/Services/'; const PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems_Region"; const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 08c58bd3..367189cd 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/profile_req_Model.dart'; +import 'package:doctor_app_flutter/presentation/doctor_app_icons.dart'; import 'package:doctor_app_flutter/providers/auth_provider.dart'; import 'package:doctor_app_flutter/providers/doctor_reply_provider.dart'; import 'package:doctor_app_flutter/providers/hospital_provider.dart'; @@ -36,6 +37,7 @@ class DashboardScreen extends StatefulWidget { final String title; final String iconURL = 'assets/images/dashboard_icon/'; + @override _DashboardScreenState createState() => _DashboardScreenState(); } @@ -44,6 +46,7 @@ class _DashboardScreenState extends State { HospitalProvider hospitalProvider; AuthProvider authProvider; bool isLoading = false; + @override Widget build(BuildContext context) { hospitalProvider = Provider.of(context); @@ -428,4 +431,96 @@ class _DashboardScreenState extends State { ), ); } + + showCupertinoPicker( + {context, List actionList, decKey, onSelectFun}) { + showModalBottomSheet( + isDismissible: false, + isScrollControlled: true, + context: context, + builder: (BuildContext builder) { + return Container( + // height: 500, + height: SizeConfig.realScreenHeight * 0.4, + color: Color(0xfff7f7f7), + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + color: Color(0xfff7f7f7), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + CupertinoButton( + child: Text( + 'Cancel'.toUpperCase(), + // style: TextStyle(context) + ), + onPressed: () { + Navigator.pop(context); + }, + ), + CupertinoButton( + child: Text( + 'Done'.toUpperCase(), + // style: textStyle(context), + ), + onPressed: () { + Navigator.pop(context); + // onSelectFun(cupertinoPickerIndex); + }, + ) + ], + ), + ), + Container( + height: SizeConfig.realScreenHeight * 0.3, + color: Color(0xfff7f7f7), + child: Column( + children: actionList + .map((e) => Container( + child: InkWell( + onTap: () => + changeClinic(e.clinicID, context), + child: Text( + e.clinicName, + style: TextStyle(fontSize: 15), + )), + )) + .toList(), + )) + ], + ), + ); + }); + } + + changeClinic(clinicId, BuildContext context) async { + Navigator.pop(context); + changeIsLoading(true); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); + ProfileReqModel docInfo = new ProfileReqModel( + doctorID: doctorProfile.doctorID, + clinicID: clinicId, + license: true, + projectID: doctorProfile.projectID, + tokenID: '', + languageID: 2); + + // authProvider.getDocProfiles(docInfo) + 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) { + setState(() { + this.isLoading = val; + }); + } }