add fun back press on relay page

merge-requests/509/head
Mohammad Aljammal 5 years ago
parent 96d861ab81
commit cb568d74c0

@ -7,7 +7,7 @@ class PatientMuseService extends BaseService {
getECGPatient({int patientType, int patientOutSA,int patientID}) async { getECGPatient({int patientType, int patientOutSA,int patientID}) async {
Map<String,dynamic> body = Map(); Map<String,dynamic> body = Map();
body['PatientType'] = patientType; body['PatientType'] = patientType==7 ? 1: patientType;
body['PatientOutSA'] = patientOutSA; body['PatientOutSA'] = patientOutSA;
body['PatientID'] = patientID; body['PatientID'] = patientID;
hasError = false; hasError = false;
@ -23,7 +23,7 @@ class PatientMuseService extends BaseService {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, },
body: body,isAllowAny: true body: body
); );
} }
} }

@ -70,10 +70,13 @@ class _LandingPageState extends State<LandingPage> {
), ),
MyScheduleScreen(), MyScheduleScreen(),
QrReaderScreen(), QrReaderScreen(),
DoctorReplyScreen(), DoctorReplyScreen(changeCurrentTab:(){
_changeCurrentTab(0);
},),
], ],
), ),
bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab), bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab,index: currentTab,),
); );
} }

@ -16,43 +16,60 @@ import 'package:flutter/material.dart';
*@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service *@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service
*/ */
class DoctorReplyScreen extends StatelessWidget { class DoctorReplyScreen extends StatelessWidget {
final Function changeCurrentTab;
const DoctorReplyScreen({Key key, this.changeCurrentTab}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<DoctorReplayViewModel>( return BaseView<DoctorReplayViewModel>(
onModelReady: (model) { onModelReady: (model) {
model.getDoctorReply(); model.getDoctorReply();
},
builder: (_, model, w) => WillPopScope(
onWillPop: ()async{
changeCurrentTab();
return false;
}, },
builder: (_, model, w) => AppScaffold( child: AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).replay2, appBarTitle: TranslationBase.of(context).replay2,
isShowAppBar: false, isShowAppBar: false,
body: model.listDoctorWorkingHoursTable.isEmpty body: model.listDoctorWorkingHoursTable.isEmpty
? DrAppEmbeddedError( ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem)
error: TranslationBase.of(context).noItem) : Container(
: Container( padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), child: ListView(
child: ListView( children: [
children: [ Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children:
children: model.listDoctorWorkingHoursTable.map((reply) {
model.listDoctorWorkingHoursTable.map((reply) { return InkWell(
return InkWell( onTap: reply.status != 2
onTap: reply.status != 2?null:() { ? null
Navigator.push( : () {
context, Navigator.push(
MaterialPageRoute( context,
builder: (BuildContext context) => MaterialPageRoute(
DoctorReplayChat(reply: reply, previousModel: model,))); builder: (BuildContext context) =>
}, DoctorReplayChat(
child: DoctorReplyWidget(reply: reply), reply: reply,
); previousModel: model,
}).toList(), )));
) },
], child: DoctorReplyWidget(reply: reply),
), );
), }).toList(),
)); )
],
),
),
),
),
);
} }
} }

@ -7,8 +7,8 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
class BottomNavBar extends StatefulWidget { class BottomNavBar extends StatefulWidget {
final ValueChanged<int> changeIndex; final ValueChanged<int> changeIndex;
final int index;
BottomNavBar({Key key, this.changeIndex}) : super(key: key); BottomNavBar({Key key, this.changeIndex, this.index}) : super(key: key);
@override @override
_BottomNavBarState createState() => _BottomNavBarState(); _BottomNavBarState createState() => _BottomNavBarState();
@ -40,7 +40,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
icon: DoctorApp.home_1, icon: DoctorApp.home_1,
activeIcon: DoctorApp.home_active_1, activeIcon: DoctorApp.home_active_1,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: _index, index: widget.index,
currentIndex: 0, currentIndex: 0,
name: TranslationBase.of(context).home, name: TranslationBase.of(context).home,
), ),
@ -48,7 +48,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
icon: DoctorApp.schedule_1, icon: DoctorApp.schedule_1,
activeIcon: DoctorApp.schedule_active_1, activeIcon: DoctorApp.schedule_active_1,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: _index, index: widget.index,
currentIndex: 1, currentIndex: 1,
name: TranslationBase.of(context).mySchedule, name: TranslationBase.of(context).mySchedule,
), ),
@ -56,7 +56,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
icon: DoctorApp.qr_reader, icon: DoctorApp.qr_reader,
activeIcon: DoctorApp.qr_reader_active_1, activeIcon: DoctorApp.qr_reader_active_1,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: _index, index: widget.index,
currentIndex: 2, currentIndex: 2,
name: TranslationBase.of(context).qr, name: TranslationBase.of(context).qr,
), ),
@ -64,7 +64,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
icon: DoctorApp.dr_reply_1, icon: DoctorApp.dr_reply_1,
activeIcon: DoctorApp.dr_reply_active_1, activeIcon: DoctorApp.dr_reply_active_1,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: _index, index: widget.index,
currentIndex: 3, currentIndex: 3,
name: TranslationBase.of(context).replay2, name: TranslationBase.of(context).replay2,
), ),

Loading…
Cancel
Save