Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into development

merge-requests/123/merge
ibrahim albitar 6 years ago
commit fc1d4c9a9b

@ -41,7 +41,7 @@ class BaseAppClient {
body['DoctorID'] = doctorProfile?.doctorID;
body['EditedBy'] = doctorProfile?.doctorID;
body['ProjectID'] = doctorProfile?.projectID;
// if (!body.containsKey('ClinicID'))
if (body['ClinicID'] == null)
body['ClinicID'] = doctorProfile?.clinicID;
}
body['TokenID'] = token ?? '';

@ -0,0 +1,183 @@
/*
*@author: Amjad Amireh
*@Date:15/6/2020
*@param:
*@return:
*@desc: Find list of pending patients Model
*/
import 'dart:convert';
ListPendingPatientListModel listPendingPatientListModelFromJson(String str) => ListPendingPatientListModel.fromJson(json.decode(str));
String listPendingPatientListModelToJson(ListPendingPatientListModel data) => json.encode(data.toJson());
class ListPendingPatientListModel {
ListPendingPatientListModel({
this.acceptedBy,
this.acceptedOn,
this.age,
this.appointmentNo,
this.arrivalTime,
this.arrivalTimeD,
this.callStatus,
this.clientRequestId,
this.clinicName,
this.consoltationEnd,
this.consultationNotes,
this.createdOn,
this.dateOfBirth,
this.deviceToken,
this.deviceType,
this.doctorName,
this.editOn,
this.gender,
this.isFollowUp,
this.isFromVida,
this.isLoginB,
this.isOutKsa,
this.isRejected,
this.language,
this.latitude,
this.longitude,
this.mobileNumber,
this.openSession,
this.openTokenId,
this.patientId,
this.patientName,
this.patientStatus,
this.preferredLanguage,
this.projectId,
this.scoring,
this.serviceId,
this.tokenId,
this.vcId,
this.voipToken,
});
dynamic acceptedBy;
dynamic acceptedOn;
int age;
dynamic appointmentNo;
String arrivalTime;
String arrivalTimeD;
int callStatus;
String clientRequestId;
String clinicName;
dynamic consoltationEnd;
dynamic consultationNotes;
dynamic createdOn;
DateTime dateOfBirth;
String deviceToken;
String deviceType;
dynamic doctorName;
String editOn;
String gender;
bool isFollowUp;
dynamic isFromVida;
int isLoginB;
bool isOutKsa;
int isRejected;
String language;
double latitude;
double longitude;
String mobileNumber;
dynamic openSession;
dynamic openTokenId;
String patientId;
String patientName;
int patientStatus;
String preferredLanguage;
int projectId;
int scoring;
int serviceId;
dynamic tokenId;
int vcId;
String voipToken;
factory ListPendingPatientListModel.fromJson(Map<String, dynamic> json) => ListPendingPatientListModel(
acceptedBy: json["AcceptedBy"],
acceptedOn: json["AcceptedOn"],
age: json["Age"],
appointmentNo: json["AppointmentNo"],
arrivalTime: json["ArrivalTime"],
arrivalTimeD: json["ArrivalTimeD"],
callStatus: json["CallStatus"],
clientRequestId: json["ClientRequestID"],
clinicName: json["ClinicName"],
consoltationEnd: json["ConsoltationEnd"],
consultationNotes: json["ConsultationNotes"],
createdOn: json["CreatedOn"],
dateOfBirth: DateTime.parse(json["DateOfBirth"]),
deviceToken: json["DeviceToken"],
deviceType: json["DeviceType"],
doctorName: json["DoctorName"],
editOn: json["EditOn"],
gender: json["Gender"],
isFollowUp: json["IsFollowUP"],
isFromVida: json["IsFromVida"],
isLoginB: json["IsLoginB"],
isOutKsa: json["IsOutKSA"],
isRejected: json["IsRejected"],
language: json["Language"],
latitude: json["Latitude"].toDouble(),
longitude: json["Longitude"].toDouble(),
mobileNumber: json["MobileNumber"],
openSession: json["OpenSession"],
openTokenId: json["OpenTokenID"],
patientId: json["PatientID"],
patientName: json["PatientName"],
patientStatus: json["PatientStatus"],
preferredLanguage: json["PreferredLanguage"],
projectId: json["ProjectID"],
scoring: json["Scoring"],
serviceId: json["ServiceID"],
tokenId: json["TokenID"],
vcId: json["VC_ID"],
voipToken: json["VoipToken"],
);
Map<String, dynamic> toJson() => {
"AcceptedBy": acceptedBy,
"AcceptedOn": acceptedOn,
"Age": age,
"AppointmentNo": appointmentNo,
"ArrivalTime": arrivalTime,
"ArrivalTimeD": arrivalTimeD,
"CallStatus": callStatus,
"ClientRequestID": clientRequestId,
"ClinicName": clinicName,
"ConsoltationEnd": consoltationEnd,
"ConsultationNotes": consultationNotes,
"CreatedOn": createdOn,
"DateOfBirth": "${dateOfBirth.year.toString().padLeft(4, '0')}-${dateOfBirth.month.toString().padLeft(2, '0')}-${dateOfBirth.day.toString().padLeft(2, '0')}",
"DeviceToken": deviceToken,
"DeviceType": deviceType,
"DoctorName": doctorName,
"EditOn": editOn,
"Gender": gender,
"IsFollowUP": isFollowUp,
"IsFromVida": isFromVida,
"IsLoginB": isLoginB,
"IsOutKSA": isOutKsa,
"IsRejected": isRejected,
"Language": language,
"Latitude": latitude,
"Longitude": longitude,
"MobileNumber": mobileNumber,
"OpenSession": openSession,
"OpenTokenID": openTokenId,
"PatientID": patientId,
"PatientName": patientName,
"PatientStatus": patientStatus,
"PreferredLanguage": preferredLanguage,
"ProjectID": projectId,
"Scoring": scoring,
"ServiceID": serviceId,
"TokenID": tokenId,
"VC_ID": vcId,
"VoipToken": voipToken,
};
}
// To parse this JSON data, do
//
// final listPendingPatientListModel = listPendingPatientListModelFromJson(jsonString);

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/models/clinic_model.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:flutter/cupertino.dart';
@ -21,7 +22,7 @@ enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED }
class AuthProvider with ChangeNotifier {
List <ClinicModel>doctorsClinicList=[];
bool isLogin= false;
bool isLoading = true;
AuthProvider(){
@ -134,6 +135,11 @@ class AuthProvider with ChangeNotifier {
await BaseAppClient.post(MEMBER_CHECK_ACTIVATION_CODE_NEW,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
response['List_DoctorsClinic'].forEach((v) {
doctorsClinicList.add(new ClinicModel.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
throw error;
}, body: activationCodeModel);

@ -9,6 +9,7 @@ class ChangePasswordScreen extends StatelessWidget {
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: false,
body: SafeArea(
child: ListView(children: <Widget>[
Container(

@ -12,8 +12,8 @@ import '../../widgets/auth/login_form.dart';
import '../../widgets/shared/app_scaffold_widget.dart';
import '../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class Loginsreen extends StatefulWidget {
@override
_LoginsreenState createState() => _LoginsreenState();
@ -56,10 +56,10 @@ class _LoginsreenState extends State<Loginsreen> {
@override
Widget build(BuildContext context) {
getSharedPref();
return AppScaffold(
isLoading: _isLoading,
isShowAppBar: false,
body: SafeArea(
child: ListView(children: <Widget>[
FutureBuilder(
@ -80,24 +80,24 @@ class _LoginsreenState extends State<Loginsreen> {
children: <Widget>[
(platformImei == null)
? Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AuthHeader(loginType.knownUser),
LoginForm(
changeLoadingStata:
changeLoadingStata,
),
],
)
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AuthHeader(loginType.knownUser),
LoginForm(
changeLoadingStata:
changeLoadingStata,
),
],
)
: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AuthHeader(loginType.unknownUser),
KnownUserLogin(),
],
),
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AuthHeader(loginType.unknownUser),
KnownUserLogin(),
],
),
]));
}
}

@ -38,6 +38,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
Widget build(BuildContext context) {
return AppScaffold(
isLoading: _isLoading,
isShowAppBar: false,
body: ListView(children: <Widget>[
Container(
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),

@ -30,6 +30,7 @@ class _VerifyAccountScreenState extends State<VerifyAccountScreen> {
Widget build(BuildContext context) {
return AppScaffold(
isLoading: _isLoading,
isShowAppBar: false,
body: SafeArea(
child: ListView(children: <Widget>[
Container(

@ -1,28 +1,36 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
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/providers/auth_provider.dart';
import 'package:doctor_app_flutter/providers/doctor_reply_provider.dart';
import 'package:doctor_app_flutter/providers/medicine_provider.dart';
import 'package:doctor_app_flutter/providers/hospital_provider.dart';
import 'package:doctor_app_flutter/providers/medicine_provider.dart';
import 'package:doctor_app_flutter/providers/referral_patient_provider.dart';
import 'package:doctor_app_flutter/providers/referred_patient_provider.dart';
import 'package:doctor_app_flutter/screens/QR_reader_screen.dart';
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:provider/provider.dart';
import '../routes.dart';
import '../widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:percent_indicator/circular_percent_indicator.dart';
import 'package:provider/provider.dart';
import '../presentation/doctor_app_icons.dart';
import '../routes.dart';
import '../widgets/dashboard/dashboard_item_icons_texts.dart';
import '../widgets/dashboard/dashboard_item_texts_widget.dart';
import '../widgets/shared/app_texts_widget.dart';
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();
class DashboardScreen extends StatefulWidget {
DashboardScreen({Key key, this.title}) : super(key: key);
@ -33,19 +41,23 @@ class DashboardScreen extends StatefulWidget {
}
class _DashboardScreenState extends State<DashboardScreen> {
HospitalProvider projectsProvider;
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();
}
projectsProvider = Provider.of(context);
return SafeArea(
bottom: true,
child: Scaffold(
child: AppScaffold(
isShowAppBar: false,
isLoading: isLoading,
body: SingleChildScrollView(
child: SizedBox(
height: MediaQuery.of(context).size.height * 1.09,
@ -65,12 +77,20 @@ class _DashboardScreenState extends State<DashboardScreen> {
),
alignment: Alignment.centerLeft,
),
Container(
margin: EdgeInsets.only(left: 10, top: 10, right: 10),
child: Icon(
Icons.settings,
size: SizeConfig.textMultiplier * 2.5,
))
InkWell(
onTap: () {
showCupertinoPicker(
context: context,
actionList: authProvider.doctorsClinicList);
},
child: Container(
margin:
EdgeInsets.only(left: 10, top: 10, right: 10),
child: Icon(
Icons.settings,
size: SizeConfig.textMultiplier * 2.5,
)),
)
]),
Container(
margin: EdgeInsets.only(left: 10, top: 5),
@ -413,17 +433,103 @@ class _DashboardScreenState extends State<DashboardScreen> {
)),
],
),
//)
// ,
//constraints: new BoxConstraints(),
),
),
),
);
}
// Container(
showCupertinoPicker(
{context, List<ClinicModel> 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: <Widget>[
Container(
color: Color(0xfff7f7f7),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
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;
});
}
}

@ -1,11 +1,11 @@
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
class MessagesScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
return AppScaffold(
isShowAppBar: false,
body: Center(
child: Text('Messages heeer'),
),

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/providers/schedule_provider.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/doctor/my_schedule_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/dr_app_circular_progress_Indeicator.dart';
import 'package:flutter/material.dart';
@ -13,7 +14,8 @@ class MyScheduleScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
scheduleProvider = Provider.of(context);
return Scaffold(
return AppScaffold(
isShowAppBar: false,
body: scheduleProvider.isLoading
? DrAppCircularProgressIndeicator()
: scheduleProvider.isError

@ -4,7 +4,8 @@ import 'package:flutter/material.dart';
class ServicesScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
return AppScaffold(
isShowAppBar: false,
body: Center(
child: Text('Services heeer'),
),

@ -98,7 +98,8 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
});
}
} catch (err) {
handelCatchErrorCase(err);
error = err;
// handelCatchErrorCase(err);
}
}

@ -22,6 +22,7 @@ import 'package:doctor_app_flutter/widgets/shared/profile_image_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:doctor_app_flutter/presentation/doctor_app_icons.dart';
import '../../config/size_config.dart';
import 'package:hexcolor/hexcolor.dart';
@ -106,7 +107,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
setState(() {
_isError = true;
_isLoading = false;
this.error = helpers.generateContactAdminMsg(error);
this.error = error;
});
});
}
@ -383,23 +384,29 @@ class _PatientsScreenState extends State<PatientsScreen> {
mainAxisAlignment:
MainAxisAlignment
.start,
children:
item.genderDescription ==
"Male"
? [
SvgPicture.asset(
url + avatarMale,
height: 80.0,
width: 80.0,
semanticsLabel: 'Male Logo')
]
: [
SvgPicture.asset(
url + avatarFemale,
height: 80.0,
width: 80.0,
semanticsLabel: 'Female Logo')
],
children: <Widget>[
Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment(-1, -1),
end: Alignment(1, 1),
colors: [
Colors.grey[100],
Colors.grey[200],
]),
boxShadow: [
BoxShadow(
color: Color.fromRGBO(0, 0, 0, 0.08),
offset: Offset(0.0, 5.0),
blurRadius: 16.0)
],
borderRadius: BorderRadius.all(Radius.circular(50.0)),
),
width: 80,
height: 80,
child: Icon(item.genderDescription == "Male" ? DoctorApp.male : DoctorApp.femaleicon,size: 80,)),
],
),
SizedBox(
width: 10,

@ -37,16 +37,26 @@ class _ProfileScreenState extends State<ProfileScreen> {
appBarTitle: 'Profile',
body: ListView(padding: EdgeInsets.zero, children: <Widget>[
Container(
height: SizeConfig.heightMultiplier * 30,
child: DrawerHeader(
child: ProfileImageWidget(
url:doctorProfile.doctorImageURL,
//"https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png",
name: doctorProfile.doctorName,//"Dr. Chris evans",
des: doctorProfile.clinicDescription//"Director of medical records",
height:MediaQuery.of(context).size.height * 0.35, //SizeConfig.heightMultiplier * 35,
child: Container(
child: DrawerHeader(
child: Container(
child: ProfileImageWidget(
url:doctorProfile.doctorImageURL,
//"https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png",
name: doctorProfile.doctorName,//"Dr. Chris evans",
des: doctorProfile.clinicDescription//"Director of medical records",
),
),
),
),
),
RoundedContainer(
child: ListView(
children: <Widget>[

@ -359,13 +359,9 @@ class _VerifyAccountState extends State<VerifyAccount> {
loginProcessCompleted(
res['List_DoctorProfile'][0], changeLoadingStata);
} else {
_asyncSimpleDialog(context, res['List_DoctorsClinic'], 'ClinicName',
'Please Select Clinic')
.then((clinicInfo) {
ClinicModel clinic = ClinicModel.fromJson(clinicInfo);
print(clinicInfo);
getDocProfiles(clinic, changeLoadingStata);
});
ClinicModel clinic =
ClinicModel.fromJson(res['List_DoctorsClinic'][0]);
getDocProfiles(clinic, changeLoadingStata);
}
} else {
changeLoadingStata(false);
@ -373,9 +369,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
}
}).catchError((err) {
changeLoadingStata(false);
print('$err');
helpers.showErrorToast();
helpers.showErrorToast(err);
});
} else {
// changeLoadingStata(false);
@ -435,18 +429,14 @@ class _VerifyAccountState extends State<VerifyAccount> {
languageID: 2);
authProv.getDocProfiles(docInfo.toJson()).then((res) {
if (res['MessageStatus'] == 1) {
print("DoctorProfileList ${res['DoctorProfileList'][0]}");
loginProcessCompleted(res['DoctorProfileList'][0], changeLoadingStata);
} else {
changeLoadingStata(false);
helpers.showErrorToast(res['ErrorEndUserMessage']);
}
}).catchError((err) {
print('$err');
changeLoadingStata(false);
print('$err');
helpers.showErrorToast();
helpers.showErrorToast(err);
});
}
}

@ -9,15 +9,16 @@ class AppScaffold extends StatelessWidget {
String appBarTitle;
Widget body;
bool isLoading;
bool isShowAppBar;
AppScaffold({this.appBarTitle ='', this.body, this.isLoading = false});
AppScaffold({this.appBarTitle ='', this.body, this.isLoading = false, this.isShowAppBar = true});
@override
Widget build(BuildContext context) {
AppGlobal.CONTEX = context;
return Scaffold(
backgroundColor: Hexcolor('#F5F5F5'),
appBar: appBarTitle != ''
appBar: isShowAppBar
? AppBar(
elevation: 0,
backgroundColor: Hexcolor('#515B5D'),

Loading…
Cancel
Save