fix cashing issue

merge-requests/838/head
Elham Rababh 4 years ago
parent b119590e39
commit 4923b66065

@ -29,71 +29,65 @@ class _AllDoctorQuestionsState extends State<AllDoctorQuestions> {
onModelReady: (model) {
model.getDoctorReply(isLocalBusy: false);
},
builder: (_, model, w) => WillPopScope(
onWillPop: () async {
widget.changeCurrentTab();
return false;
},
child: AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).replay2,
isShowAppBar: false,
body: model.listDoctorWorkingHoursTable.isEmpty
?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(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.listDoctorWorkingHoursTable.length,
shrinkWrap: true,
itemBuilder: (BuildContext ctxt, int index) {
return Column(
children: [
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
DoctorReplayChat(
reply:
model.listDoctorWorkingHoursTable[
index],
previousModel: model,
),
settings: RouteSettings(
name: 'DoctorReplayChat'),
));
},
child: DoctorReplyWidget(
reply: model
.listDoctorWorkingHoursTable[index]),
),
if(model.state == ViewState.BusyLocal && index == model.listDoctorWorkingHoursTable.length-1)
DrAppCircularProgressIndeicator()
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).replay2,
isShowAppBar: false,
body: model.listDoctorWorkingHoursTable.isEmpty
?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(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.listDoctorWorkingHoursTable.length,
shrinkWrap: true,
itemBuilder: (BuildContext ctxt, int index) {
return Column(
children: [
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
DoctorReplayChat(
reply:
model.listDoctorWorkingHoursTable[
index],
previousModel: model,
),
settings: RouteSettings(
name: 'DoctorReplayChat'),
));
},
child: DoctorReplyWidget(
reply: model
.listDoctorWorkingHoursTable[index]),
),
if(model.state == ViewState.BusyLocal && index == model.listDoctorWorkingHoursTable.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);
}
return;
},
),
],
);
}),
onNotification: (t) {
if (t is ScrollUpdateNotification && t.metrics.pixels >= t.metrics.maxScrollExtent - 50 &&
model.state != ViewState.BusyLocal) {
setState(() {
pageIndex++;
});
model.getDoctorReply(pageIndex: pageIndex);
}
return;
},
),
),
],
),
),
],
),
),
);

@ -202,9 +202,11 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
CustomRow(
label: TranslationBase.of(context).fileNumber,
value: widget.reply.patientID.toString(),
isCopyable:false,
),
CustomRow(
label: TranslationBase.of(context).age + " : ",
isCopyable:false,
value:
"${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}",
),

@ -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;
},
),
),
],
),
),
),
],
),
),
);
}

@ -7,7 +7,7 @@ class CustomRow extends StatelessWidget {
const CustomRow({
Key key,
this.label,
this.value, this.labelSize, this.valueSize, this.width,
this.value, this.labelSize, this.valueSize, this.width, this.isCopyable= true,
}) : super(key: key);
final String label;
@ -15,6 +15,7 @@ class CustomRow extends StatelessWidget {
final double labelSize;
final double valueSize;
final double width;
final bool isCopyable;
@override
Widget build(BuildContext context) {
@ -35,7 +36,7 @@ class CustomRow extends StatelessWidget {
fontSize: valueSize??SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: Color(0xFF2E303A),
fontWeight: FontWeight.w700,
isCopyable: true,
isCopyable: isCopyable,
),
],
);

Loading…
Cancel
Save