mirrored_repositories/Blooddonation_flutter/lib
import 'package:flutter/material.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';
import 'package:new_blood/model/event.dart';

class EventDataSource extends CalendarDataSource {
  EventDataSource(List<Event> appointments) {
    this.appointments = appointments;
  }

  Event getEvent(int index) => appointments![index] as Event;

  @override
  DateTime getStartTime (int index) => getEvent(index).from;

  @override
  DateTime getEndTime (int index) => getEvent(index).to;

  @override
  String getSubjext (int index) => getEvent(index).title;

  @override
  Color getColor (int index) => getEvent(index).backgroundColor;

  @override
  bool getisAllDay (int index) => getEvent(index).isAllDay;



}