|
|
|
|
@ -31,79 +31,73 @@ class _NotRepliedDoctorQuestionsState extends State<NotRepliedDoctorQuestions> {
|
|
|
|
|
onModelReady: (model) {
|
|
|
|
|
model.getDoctorReply(isLocalBusy: false, isGettingNotReply: true);
|
|
|
|
|
},
|
|
|
|
|
builder: (_, model, w) => WillPopScope(
|
|
|
|
|
onWillPop: () async {
|
|
|
|
|
widget.changeCurrentTab();
|
|
|
|
|
return false;
|
|
|
|
|
},
|
|
|
|
|
child: AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
appBarTitle: TranslationBase.of(context).replay2,
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
body: model.listDoctorNotRepliedQuestions.isEmpty
|
|
|
|
|
? ErrorMessage(error: TranslationBase.of(context).noItem)
|
|
|
|
|
: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
|
|
|
|
|
child: NotificationListener(
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
itemCount:
|
|
|
|
|
model.listDoctorNotRepliedQuestions.length,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemBuilder: (BuildContext ctxt, int index) {
|
|
|
|
|
return Column(
|
|
|
|
|
children: [
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (BuildContext context) =>
|
|
|
|
|
DoctorReplayChat(
|
|
|
|
|
reply: model
|
|
|
|
|
.listDoctorNotRepliedQuestions[
|
|
|
|
|
index],
|
|
|
|
|
previousModel: model,
|
|
|
|
|
),
|
|
|
|
|
settings: RouteSettings(
|
|
|
|
|
name: 'DoctorReplayChat'),
|
|
|
|
|
));
|
|
|
|
|
},
|
|
|
|
|
child: DoctorReplyWidget(
|
|
|
|
|
reply:
|
|
|
|
|
model.listDoctorNotRepliedQuestions[
|
|
|
|
|
index]),
|
|
|
|
|
),
|
|
|
|
|
if (model.state == ViewState.BusyLocal &&
|
|
|
|
|
index ==
|
|
|
|
|
model.listDoctorNotRepliedQuestions
|
|
|
|
|
.length -
|
|
|
|
|
1)
|
|
|
|
|
DrAppCircularProgressIndeicator()
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
onNotification: (t) {
|
|
|
|
|
if (t is ScrollUpdateNotification &&
|
|
|
|
|
t.metrics.pixels >=
|
|
|
|
|
t.metrics.maxScrollExtent - 50 &&
|
|
|
|
|
model.state != ViewState.BusyLocal) {
|
|
|
|
|
setState(() {
|
|
|
|
|
pageIndex++;
|
|
|
|
|
});
|
|
|
|
|
model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true);
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
appBarTitle: TranslationBase.of(context).replay2,
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
body: model.listDoctorNotRepliedQuestions.isEmpty
|
|
|
|
|
? ErrorMessage(error: TranslationBase.of(context).noItem)
|
|
|
|
|
: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
|
|
|
|
|
child: NotificationListener(
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
itemCount:
|
|
|
|
|
model.listDoctorNotRepliedQuestions.length,
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemBuilder: (BuildContext ctxt, int index) {
|
|
|
|
|
return Column(
|
|
|
|
|
children: [
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (BuildContext context) =>
|
|
|
|
|
DoctorReplayChat(
|
|
|
|
|
reply: model
|
|
|
|
|
.listDoctorNotRepliedQuestions[
|
|
|
|
|
index],
|
|
|
|
|
previousModel: model,
|
|
|
|
|
),
|
|
|
|
|
settings: RouteSettings(
|
|
|
|
|
name: 'DoctorReplayChat'),
|
|
|
|
|
));
|
|
|
|
|
},
|
|
|
|
|
child: DoctorReplyWidget(
|
|
|
|
|
reply:
|
|
|
|
|
model.listDoctorNotRepliedQuestions[
|
|
|
|
|
index]),
|
|
|
|
|
),
|
|
|
|
|
if (model.state == ViewState.BusyLocal &&
|
|
|
|
|
index ==
|
|
|
|
|
model.listDoctorNotRepliedQuestions
|
|
|
|
|
.length -
|
|
|
|
|
1)
|
|
|
|
|
DrAppCircularProgressIndeicator()
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
onNotification: (t) {
|
|
|
|
|
if (t is ScrollUpdateNotification &&
|
|
|
|
|
t.metrics.pixels >=
|
|
|
|
|
t.metrics.maxScrollExtent - 50 &&
|
|
|
|
|
model.state != ViewState.BusyLocal) {
|
|
|
|
|
setState(() {
|
|
|
|
|
pageIndex++;
|
|
|
|
|
});
|
|
|
|
|
model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true);
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|