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

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

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

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

Loading…
Cancel
Save