import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class AppointmentCard extends StatelessWidget {
  final AppoitmentAllHistoryResultList appointment;

  const AppointmentCard({Key key, this.appointment}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      margin: EdgeInsets.all(8),
      padding: EdgeInsets.all(10),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(8),
      ),
      child: Row(
        children: [
          LargeAvatar(
            url: appointment.doctorImageURL,
            name: appointment.doctorNameObj,
          ),
          Expanded(
            child: Padding(
              padding: const EdgeInsets.all(8.0),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Texts(appointment.doctorNameObj,bold: true,),
                  SizedBox(height: 4,),
                  Texts(appointment.projectName),
                  Texts(appointment.clinicName),
                  Texts(DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appointment.bookDate))),
                ],
              ),
            ),
          )
        ],
      ),
    );
  }
}
