Merge branch 'replay_taps' into 'development'

fix cashing issue

See merge request Cloud_Solution/doctor_app_flutter!838
merge-requests/840/head
Mohammad Aljammal 5 years ago
commit b2ce970195

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

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

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

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

Loading…
Cancel
Save