|
|
|
@ -1,10 +1,15 @@
|
|
|
|
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/doctor/doctor_repaly_chat.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
|
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/errors/dr_app_embedded_error.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
@ -15,21 +20,27 @@ import 'package:flutter/material.dart';
|
|
|
|
|
*@return:
|
|
|
|
|
*@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service
|
|
|
|
|
*/
|
|
|
|
|
class DoctorReplyScreen extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
class DoctorReplyScreen extends StatefulWidget {
|
|
|
|
|
final Function changeCurrentTab;
|
|
|
|
|
|
|
|
|
|
const DoctorReplyScreen({Key key, this.changeCurrentTab}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_DoctorReplyScreenState createState() => _DoctorReplyScreenState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _DoctorReplyScreenState extends State<DoctorReplyScreen> {
|
|
|
|
|
int pageIndex = 1;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return BaseView<DoctorReplayViewModel>(
|
|
|
|
|
onModelReady: (model) {
|
|
|
|
|
model.getDoctorReply();
|
|
|
|
|
model.getDoctorReply(isLocalBusy: false);
|
|
|
|
|
},
|
|
|
|
|
builder: (_, model, w) => WillPopScope(
|
|
|
|
|
onWillPop: ()async{
|
|
|
|
|
changeCurrentTab();
|
|
|
|
|
onWillPop: () async {
|
|
|
|
|
widget.changeCurrentTab();
|
|
|
|
|
return false;
|
|
|
|
|
},
|
|
|
|
|
child: AppScaffold(
|
|
|
|
@ -45,22 +56,46 @@ class DoctorReplyScreen extends StatelessWidget {
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children:
|
|
|
|
|
model.listDoctorWorkingHoursTable.map((reply) {
|
|
|
|
|
children: model.listDoctorWorkingHoursTable.map(
|
|
|
|
|
(reply) {
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (BuildContext context) =>
|
|
|
|
|
DoctorReplayChat(
|
|
|
|
|
reply: reply,
|
|
|
|
|
previousModel: model,
|
|
|
|
|
), settings: RouteSettings(name: 'DoctorReplayChat'),));
|
|
|
|
|
},
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (BuildContext context) =>
|
|
|
|
|
DoctorReplayChat(
|
|
|
|
|
reply: reply,
|
|
|
|
|
previousModel: model,
|
|
|
|
|
),
|
|
|
|
|
settings:
|
|
|
|
|
RouteSettings(name: 'DoctorReplayChat'),
|
|
|
|
|
));
|
|
|
|
|
},
|
|
|
|
|
child: DoctorReplyWidget(reply: reply),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
}).toList()
|
|
|
|
|
..add(InkWell(
|
|
|
|
|
onTap: () async {
|
|
|
|
|
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,),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
@ -68,6 +103,5 @@ class DoctorReplyScreen extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|