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/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/errors/dr_app_embedded_error.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

/*
 *@author: Mohammad Aljammal
 *@Date:28/4/2020
 *@param:
 *@return:
 *@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service
 */
class DoctorReplyScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return BaseView<DoctorReplayViewModel>(
        onModelReady: (model) => model.getDoctorReply(),
        builder: (_, model, w) => AppScaffold(
              baseViewModel: model,
              appBarTitle: TranslationBase.of(context).replay2,
              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 DoctorReplyWidget(reply: reply);
                            }).toList(),
                          )
                        ],
                      ),
                    ),
            ));
  }
}
