Skip to content

SfCalendar causing assertion when an appointment is scrolled up and down in day calendar view #296

@misici234

Description

@misici234

I have an appointment in SfCalendar displayed in Day calendar view. When I scroll it up and down quickly, after a few iterations I get this assertion
======== Exception caught by scheduler library =====================================================
The following assertion was thrown during a scheduler callback:
'package:flutter/src/semantics/semantics.dart': Failed assertion: line 1519 pos 12: '!owner._nodes.containsKey(id)': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=BUG.md

When the exception was thrown, this was the stack:
#2 SemanticsNode.attach (package:flutter/src/semantics/semantics.dart:1519:12)
#3 AbstractNode.adoptChild (package:flutter/src/foundation/node.dart:132:13)
#4 SemanticsNode._replaceChildren (package:flutter/src/semantics/semantics.dart:1446:11)
#5 SemanticsNode.updateWith (package:flutter/src/semantics/semantics.dart:1878:5)
#6 RenderObject.assembleSemanticsNode (package:flutter/src/rendering/object.dart:2778:10)

I noticed this problem in
syncfusion_flutter_calendar: ^18.4.32
and reproduced in
syncfusion_flutter_calendar: ^18.4.46
Here is a code sample

              return SfCalendar(
                controller: calendarController,
                dataSource: MeetingDataSource(snapshot.data),
                monthViewSettings: MonthViewSettings(
                  appointmentDisplayMode: MonthAppointmentDisplayMode.appointment,
                ),
                // timeSlotViewSettings: TimeSlotViewSettings(minimumAppointmentDuration: Duration(minutes: 1)),
                timeSlotViewSettings: TimeSlotViewSettings(
                  timeInterval: const Duration(minutes: 30),
                  //   minimumAppointmentDuration: const Duration(minutes: 1),
                  timeFormat: 'h:mm a',
                  //   timeRulerSize: 70,
                ),
                appointmentTimeTextFormat: 'h:mm a',
                appointmentTextStyle: TextStyle(color: Colors.black, fontSize: 10, fontWeight: FontWeight.w700),
                onTap: (CalendarTapDetails calendarDetails) async {

If I use default values like
timeSlotViewSettings: TimeSlotViewSettings(minimumAppointmentDuration: Duration(minutes: 1)),
I don't get above assertion.

/Users/???????????/Developer/SDKs/flutter/bin/flutter doctor --verbose
[✓] Flutter (Channel stable, 1.22.6, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-CA)
• Flutter version 1.22.6 at /Users/borismisic/Developer/SDKs/flutter
• Framework revision 9b2d32b605 (6 weeks ago), 2021-01-22 14:36:39 -0800
• Engine revision 2f0af37152
• Dart version 2.10.5

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/borismisic/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = /Users/borismisic/Library/Android/sdk
• ANDROID_SDK_ROOT = /Users/borismisic/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.9.3

[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin installed
• Dart plugin version 201.9317
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] Connected device (2 available)
• iPhone 12 (mobile) • 5D81B0D2-A52B-4183-8690-3368B83F878C • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
• iPad Pro (12.9-inch) (4th generation) (mobile) • C16C7929-DEED-4CD1-AB1A-883B27D134C3 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)
! Error: Boris’s iPhone is not connected. Xcode will continue when Boris’s iPhone is connected. (code -13)

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions