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!

0
Votes

Assertion failed: file:///C:/Users/hp/AppData/Local/Pub/Cache/hosted/pub.dev/syncfusion_flutter_calendar-24.1.45/lib/src/calendar/views/calendar_view.dart:13488:10 customObject != null "Implement convertToCalendarAppointment method from CalendarDataSource"

This is the Error i am getting,
this is my code

import 'dart:ui';

import 'package:activity_planner_calendar_event/Meetings.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';

class MeetingDataSource extends CalendarDataSource {
  MeetingDataSource(List<Meeting> source) {
    appointments = source;
  }

  @override
  DateTime getStartTime(int index) {
    return appointments![index].from;
  }

  @override
  DateTime getEndTime(int index) {
    return appointments![index].to;
  }

  @override
  String getSubject(int index) {
    return appointments![index].eventName;
  }

  @override
  int getId(int index) {
    return appointments![index].id;
  }

  @override
  Color getColor(int index) {
    return appointments![index].background;
  }

  @override
  bool isAllDay(int index) {
    return appointments![index].isAllDay;
  }

  @override
  Meeting? convertAppointmentToObject(
      Meeting? customData, Appointment appointment) {
    return Meeting(
      from: appointment.startTime,
      to: appointment.endTime,
      content: appointment.subject,
      background: appointment.color,
      isAllDay: appointment.isAllDay,
      // id: appointment.id
    );
  }

}

class Meeting {
  Meeting({
    required this.content,
    // required this.id,
    required this.from,
    required this.to,
    required this.background,
    required this.isAllDay,
  });

  String content;
  // int id;
  DateTime from;
  DateTime to;
  Color background;
  bool isAllDay;
}

Please have a look over it