|
|
|
|
@ -16,43 +16,60 @@ 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();
|
|
|
|
|
onModelReady: (model) {
|
|
|
|
|
model.getDoctorReply();
|
|
|
|
|
},
|
|
|
|
|
builder: (_, model, w) => WillPopScope(
|
|
|
|
|
onWillPop: ()async{
|
|
|
|
|
changeCurrentTab();
|
|
|
|
|
return false;
|
|
|
|
|
},
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
appBarTitle: TranslationBase.of(context).replay2,
|
|
|
|
|
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 InkWell(
|
|
|
|
|
onTap: reply.status != 2?null:() {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (BuildContext context) =>
|
|
|
|
|
DoctorReplayChat(reply: reply, previousModel: model,)));
|
|
|
|
|
},
|
|
|
|
|
child: DoctorReplyWidget(reply: reply),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
child: AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
appBarTitle: TranslationBase.of(context).replay2,
|
|
|
|
|
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 InkWell(
|
|
|
|
|
onTap: reply.status != 2
|
|
|
|
|
? null
|
|
|
|
|
: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (BuildContext context) =>
|
|
|
|
|
DoctorReplayChat(
|
|
|
|
|
reply: reply,
|
|
|
|
|
previousModel: model,
|
|
|
|
|
)));
|
|
|
|
|
},
|
|
|
|
|
child: DoctorReplyWidget(reply: reply),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|