Welcome to the Flutter feedback portal. We’re happy you’re here! If you have feedback on how to improve the Flutter, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

1
Vote

While implementing the convertAppointmentToObject method for my custom appointment data source I keep getting this error: 

'EventDataSource.convertAppointmentToObject' ('Event Function(Event, Appointment)') isn't a valid override of 'CalendarDataSource.convertAppointmentToObject' ('Object? Function(Object?, Appointment)'). (Documentation)

Despite referencing other feedbacks on similar issues. Here is the code for my  datasource which I believe I have followed other references closely->

import 'package:project/models/event.dart';
import 'package:flutter/material.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';

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

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 getSubject(int index) => getEvent(index).title;

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

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

@override
String getRecurrenceRule(int index) => getEvent(index).recurrenceRule;

@override
String getNotes(int index) => getEvent(index).description;

@override
Event convertAppointmentToObject(
Event customData, Appointment appointment){
//conversion logic
return Event(
title: appointment.subject,
from: appointment.startTime,
to: appointment.endTime,
isAllDay: appointment.isAllDay,
recurrenceRule: appointment.recurrenceRule!,
description: appointment.notes!
);
}
}