import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/providers/doctor_reply_provider.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/patients/profile/large_avatar.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/card_with_bgNew_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';

/*
 *@author: Mohammad Aljammal
 *@Date:28/4/2020
 *@param:
 *@return:
 *@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service
 */
class DoctorReplyScreen extends StatelessWidget {
  DoctorReplyProvider _doctorReplyProvider;

  @override
  Widget build(BuildContext context) {
    _doctorReplyProvider = Provider.of(context);
    return AppScaffold(
      appBarTitle: TranslationBase.of(context).replay2,
      body: _doctorReplyProvider.isLoading
          ? DrAppCircularProgressIndeicator()
          : _doctorReplyProvider.isError
              ? Center(
                  child: Text(
                    _doctorReplyProvider.error,
                    style: TextStyle(color: Theme.of(context).errorColor),
                  ),
                )
              : Container(
                  padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0),
                  child: ListView(
                    children: [
                      Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: _doctorReplyProvider
                            .listDoctorWorkingHoursTable
                            .map((reply) {
                          return DoctorReplyWidget(reply: reply);
                        }).toList(),
                      )
                    ],
                  ),
                ),
    );
  }
}
