Merge branch 'development' into app_changes

merge-requests/344/head
mosazaid 4 years ago
commit 7c5d88f169

@ -1,4 +1,6 @@
import 'package:doctor_app_flutter/screens/QR_reader_screen.dart';
import 'package:doctor_app_flutter/screens/dashboard_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/doctor_reply_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/message_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart';
import 'package:doctor_app_flutter/screens/doctor/services_screen.dart';
@ -64,9 +66,9 @@ class _LandingPageState extends State<LandingPage> {
ShowCaseWidget(
builder: Builder(builder: (context) => DashboardScreen()),
),
// MessagesScreen(),
DoctorReplyScreen(),
MyScheduleScreen(),
// ServicesScreen()
QrReaderScreen()
],
),
bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab),
@ -82,7 +84,7 @@ class _LandingPageState extends State<LandingPage> {
case 2:
return TranslationBase.of(context).mySchedule;
case 3:
return TranslationBase.of(context).services;
return TranslationBase.of(context).qr;
}
}
}

@ -17,6 +17,7 @@ import 'package:flutter/material.dart';
import '../routes.dart';
import 'base/base_view.dart';
Helpers helpers = Helpers();
class QrReaderScreen extends StatefulWidget {
@ -59,6 +60,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
onModelReady: (model) => model.getClinicsList(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
appBarTitle:
TranslationBase.of(context).qr + TranslationBase.of(context).reader,
body: Center(
@ -71,63 +73,63 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
AppText(
TranslationBase.of(context).startScanning,
fontSize: 18,
fontWeight: FontWeight.bold,
textAlign: TextAlign.center,
),
SizedBox(
height: 7,
),
AppText(TranslationBase.of(context).scanQrCode,
fontSize: 14,
fontWeight: FontWeight.w400,
textAlign: TextAlign.center),
SizedBox(
height: 15,
),
Container(
height: 150,
child: Image.asset('assets/images/qr_code.png'),
),
SizedBox(
height: 35,
),
Button(
onTap: () {
_scanQrAndGetPatient(context, model);
},
title: TranslationBase.of(context).scanQr,
loading: isLoading,
icon: Image.asset('assets/images/qr_code_white.png'),
),
isError
? Container(
margin: EdgeInsets.only(top: 8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0),
color: Theme.of(context).errorColor.withOpacity(0.06),
),
padding: EdgeInsets.symmetric(
vertical: 8.0, horizontal: 12.0),
child: Row(
children: <Widget>[
Expanded(
child: AppText(
error ??
TranslationBase.of(context)
.errorMessage,
color: Theme
.of(context)
.errorColor)),
],
),
)
: Container(),
],
fontWeight: FontWeight.bold,
textAlign: TextAlign.center,
),
SizedBox(
height: 7,
),
AppText(TranslationBase.of(context).scanQrCode,
fontSize: 14,
fontWeight: FontWeight.w400,
textAlign: TextAlign.center),
SizedBox(
height: 15,
),
Container(
height: 150,
child: Image.asset('assets/images/qr_code.png'),
),
),
SizedBox(
height: 35,
),
Button(
onTap: () {
_scanQrAndGetPatient(context, model);
},
title: TranslationBase.of(context).scanQr,
loading: isLoading,
icon: Image.asset('assets/images/qr_code_white.png'),
),
isError
? Container(
margin: EdgeInsets.only(top: 8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0),
color:
Theme.of(context).errorColor.withOpacity(0.06),
),
padding: EdgeInsets.symmetric(
vertical: 8.0, horizontal: 12.0),
child: Row(
children: <Widget>[
Expanded(
child: AppText(
error ??
TranslationBase.of(context)
.errorMessage,
color: Theme.of(context).errorColor)),
],
),
)
: Container(),
],
),
),
),);
),
),
),
);
}
_scanQrAndGetPatient(BuildContext context, PatientViewModel model) async {
@ -135,7 +137,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
/// var result = await BarcodeScanner.scan();
/// int patientID = get from qr result
var result = await BarcodeScanner.scan();
if (result.rawContent != "") {
if (result.rawContent != "") {
List<String> listOfParams = result.rawContent.split(',');
String patientType = "1";
setState(() {
@ -152,66 +154,65 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
// patient.setClinicID = doctorProfile.clinicID;
// patient.setProjectID = doctorProfile.projectID;
// Provider.of<PatientsProvider>(context, listen: false);
patient.PatientID = 8808;
patient.TokenID = token;
model
.getPatientList(patient, "1", isBusyLocal: true)
.then((response) {
if (response['MessageStatus'] == 1) {
switch (patientType) {
case "0":
if (response['List_MyOutPatient'] != null) {
setState(() {
patientList =
ModelResponse.fromJson(response['List_MyOutPatient']).list;
isLoading = false;
});
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patientList[0],
});
} else {
setState(() {
isError = true;
isLoading = false;
});
DrAppToastMsg.showErrorToast('No patient');
}
break;
case "1":
if (response['List_MyInPatient'] != null) {
setState(() {
patientList =
ModelResponse.fromJson(response['List_MyInPatient']).list;
isLoading = false;
error = "";
});
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patientList[0],
});
} else {
setState(() {
isError = true;
isLoading = false;
});
DrAppToastMsg.showErrorToast('No patient');
patient.PatientID = 8808;
patient.TokenID = token;
model.getPatientList(patient, "1", isBusyLocal: true).then((response) {
if (response['MessageStatus'] == 1) {
switch (patientType) {
case "0":
if (response['List_MyOutPatient'] != null) {
setState(() {
patientList =
ModelResponse.fromJson(response['List_MyOutPatient'])
.list;
isLoading = false;
});
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patientList[0],
});
} else {
setState(() {
isError = true;
isLoading = false;
});
DrAppToastMsg.showErrorToast('No patient');
}
break;
}
case "1":
if (response['List_MyInPatient'] != null) {
setState(() {
patientList =
ModelResponse.fromJson(response['List_MyInPatient']).list;
isLoading = false;
error = "";
});
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patientList[0],
});
} else {
setState(() {
isError = true;
isLoading = false;
});
DrAppToastMsg.showErrorToast('No patient');
break;
}
}
} else {
setState(() {
isLoading = false;
isError = true;
});
DrAppToastMsg.showErrorToast(
response['ErrorEndUserMessage'] ?? response['ErrorMessage']);
}
} else {
}).catchError((error) {
setState(() {
isLoading = false;
isError = true;
});
DrAppToastMsg.showErrorToast(
response['ErrorEndUserMessage'] ?? response['ErrorMessage']);
}
}).catchError((error) {
setState(() {
isLoading = false;
helpers.showErrorToast(error.message);
//DrAppToastMsg.showErrorToast(error);
});
helpers.showErrorToast(error.message);
//DrAppToastMsg.showErrorToast(error);
});
}
}
}
}

@ -989,50 +989,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
);
},
),
DashboardItem(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Icon(
DoctorApp.qr_code,
size: 50,
color: Colors.black,
),
Column(
children: [
AppText(
projectsProvider.isArabic
? TranslationBase.of(context).reader
: TranslationBase.of(context).qr,
color: Colors.black,
textAlign: TextAlign.center,
),
AppText(
projectsProvider.isArabic
? TranslationBase.of(context).qr
: TranslationBase.of(context).reader,
color: Colors.black,
textAlign: TextAlign.center,
),
],
)
],
),
// imageName: '1.png',
hasBorder: true,
onTap: () {
Navigator.of(context).pushNamed(QR_READER);
},
),
],
),
SizedBox(
height: 20,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
DashboardItem(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
@ -1060,44 +1016,88 @@ class _DashboardScreenState extends State<DashboardScreen> {
);
},
),
// DashboardItem(
// child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// children: <Widget>[
// Icon(
// DoctorApp.qr_code,
// size: 50,
// color: Colors.black,
// ),
// Column(
// children: [
// AppText(
// projectsProvider.isArabic
// ? TranslationBase.of(context).reader
// : TranslationBase.of(context).qr,
// color: Colors.black,
// textAlign: TextAlign.center,
// ),
// AppText(
// projectsProvider.isArabic
// ? TranslationBase.of(context).qr
// : TranslationBase.of(context).reader,
// color: Colors.black,
// textAlign: TextAlign.center,
// ),
// ],
// )
// ],
// ),
// // imageName: '1.png',
// hasBorder: true,
// onTap: () {
// Navigator.of(context).pushNamed(QR_READER);
// },
// ),
],
),
SizedBox(
height: 20,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: 8,
),
DashboardItem(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Icon(
DoctorApp.mail,
size: 50,
color: Colors.black,
),
Column(
children: [
AppText(
TranslationBase.of(context).theDoctor,
textAlign: TextAlign.center,
color: Colors.black,
),
AppText(
TranslationBase.of(context).reply,
textAlign: TextAlign.center,
color: Colors.black,
),
],
)
],
),
hasBorder: true,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => DoctorReplyScreen(),
),
);
},
)
// DashboardItem(
// child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// children: <Widget>[
// Icon(
// DoctorApp.mail,
// size: 50,
// color: Colors.black,
// ),
// Column(
// children: [
// AppText(
// TranslationBase.of(context).theDoctor,
// textAlign: TextAlign.center,
// color: Colors.black,
// ),
// AppText(
// TranslationBase.of(context).reply,
// textAlign: TextAlign.center,
// color: Colors.black,
// ),
// ],
// )
// ],
// ),
// hasBorder: true,
// onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => DoctorReplyScreen(),
// ),
// );
// },
// )
],
),
SizedBox(
@ -1275,7 +1275,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
authProvider.getDocProfiles(docInfo.toJson()).then((res) async {
changeIsLoading(false);
sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]);
model.getDashboard();
// model.getDashboard();
}).catchError((err) {
changeIsLoading(false);
helpers.showErrorToast(err);

@ -15,32 +15,32 @@ import 'package:flutter/material.dart';
*@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service
*/
class DoctorReplyScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BaseView<DoctorReplayViewModel>(
onModelReady: (model) => model.getDoctorReply(),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
baseViewModel: model,
appBarTitle: TranslationBase.of(context).replay2,
body: model
.listDoctorWorkingHoursTable.isEmpty ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem):Container(
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
child: ListView(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: model
.listDoctorWorkingHoursTable
.map((reply) {
return DoctorReplyWidget(reply: reply);
}).toList(),
)
],
),
),
isShowAppBar: false,
body: model.listDoctorWorkingHoursTable.isEmpty
? DrAppEmbeddedError(
error: TranslationBase.of(context).noItem)
: Container(
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
child: ListView(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children:
model.listDoctorWorkingHoursTable.map((reply) {
return DoctorReplyWidget(reply: reply);
}).toList(),
)
],
),
),
));
}
}

@ -303,8 +303,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
});
},
child: Icon(isHistoryExpand
? EvaIcons.minus
: EvaIcons.plus))
? EvaIcons.arrowUp
: EvaIcons.arrowDown))
],
),
bodyWidget: ListView.builder(
@ -404,8 +404,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
});
},
child: Icon(isAssessmentExpand
? EvaIcons.minus
: EvaIcons.plus))
? EvaIcons.arrowUp
: EvaIcons.arrowDown))
],
),
bodyWidget: ListView.builder(
@ -584,8 +584,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
});
},
child: Icon(isProcedureExpand
? EvaIcons.minus
: EvaIcons.plus))
? EvaIcons.arrowUp
: EvaIcons.arrowDown))
],
),
bodyWidget: ListView.builder(
@ -758,8 +758,8 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
});
},
child: Icon(isPhysicalExam
? EvaIcons.minus
: EvaIcons.plus))
? EvaIcons.arrowUp
: EvaIcons.arrowDown))
],
),
bodyWidget: ListView.builder(

@ -630,7 +630,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
.toString(),
patient: patient,
drugId: model.prescriptionList[0].entityList[index].medicineCode,
drugName: model.prescriptionList[0].entityList[index].doseDetail,
drugName: model.prescriptionList[0].entityList[index].medicationName,
remarks: model.prescriptionList[0].entityList[index].remarks,
model: model,
enteredRemarks: model.prescriptionList[0].entityList[index].remarks,

@ -44,14 +44,14 @@ class _BottomNavBarState extends State<BottomNavBar> {
currentIndex: 0,
name: TranslationBase.of(context).home,
),
// BottomNavigationItem(
// icon: DoctorApp.message_icon,
// activeIcon: DoctorApp.message_icon_active,
// changeIndex: _changeIndex,
// index: _index,
// currentIndex: 1,
// name: TranslationBase.of(context).replay2,
// ),
BottomNavigationItem(
icon: DoctorApp.message_icon,
activeIcon: DoctorApp.message_icon_active,
changeIndex: _changeIndex,
index: _index,
currentIndex: 1,
name: TranslationBase.of(context).replay2,
),
BottomNavigationItem(
icon: DoctorApp.schedule_icon,
activeIcon: DoctorApp.scdedule_icon_active,
@ -60,14 +60,14 @@ class _BottomNavBarState extends State<BottomNavBar> {
currentIndex: 2,
name: TranslationBase.of(context).mySchedule,
),
// BottomNavigationItem(
// icon: DoctorApp.menu_icon,
// activeIcon: DoctorApp.menu_icon_active,
// changeIndex: _changeIndex,
// index: _index,
// currentIndex: 3,
// name: TranslationBase.of(context).services,
// )
BottomNavigationItem(
icon: DoctorApp.qr_code,
activeIcon: DoctorApp.qr_code,
changeIndex: _changeIndex,
index: _index,
currentIndex: 3,
name: TranslationBase.of(context).qr,
)
],
),
),

@ -403,6 +403,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_page_indicator:
dependency: transitive
description:
name: flutter_page_indicator
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.3"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
@ -410,6 +417,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.11"
flutter_swiper:
dependency: "direct main"
description:
name: flutter_swiper
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
flutter_test:
dependency: "direct dev"
description: flutter
@ -873,6 +887,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1+3"
transformer_page_view:
dependency: transitive
description:
name: transformer_page_view
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.6"
typed_data:
dependency: transitive
description:

Loading…
Cancel
Save