|
|
|
|
@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/doctor/doctor_reply_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
@ -49,57 +50,61 @@ class _DoctorReplyScreenState extends State<DoctorReplyScreen> {
|
|
|
|
|
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: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (BuildContext context) =>
|
|
|
|
|
DoctorReplayChat(
|
|
|
|
|
reply: reply,
|
|
|
|
|
previousModel: model,
|
|
|
|
|
: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
|
|
|
|
|
child: NotificationListener(
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
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]),
|
|
|
|
|
),
|
|
|
|
|
settings:
|
|
|
|
|
RouteSettings(name: 'DoctorReplayChat'),
|
|
|
|
|
));
|
|
|
|
|
},
|
|
|
|
|
child: DoctorReplyWidget(reply: reply),
|
|
|
|
|
);
|
|
|
|
|
}).toList()
|
|
|
|
|
..add(InkWell(
|
|
|
|
|
onTap: () async {
|
|
|
|
|
if(model.state == ViewState.BusyLocal &&index ==model.listDoctorWorkingHoursTable.length-1)
|
|
|
|
|
DrAppCircularProgressIndeicator()
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
onNotification: (t) {
|
|
|
|
|
if (t is ScrollEndNotification &&
|
|
|
|
|
model.state != ViewState.BusyLocal) {
|
|
|
|
|
print("${model.state}");
|
|
|
|
|
setState(() {
|
|
|
|
|
pageIndex++;
|
|
|
|
|
});
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await model.getDoctorReply(pageIndex: pageIndex);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
|
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
|
} else
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
},
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: EdgeInsets.all(20),
|
|
|
|
|
child: AppText("${TranslationBase.of(context).seeMore}", fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*4,),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
model.getDoctorReply(pageIndex: pageIndex);
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|