Skyost / FlutterWeekView

Displays a highly customizable week view (or day view) which is able to display events, to be scrolled, to be zoomed-in & out and a lot more !
https://pub.dev/packages/flutter_week_view
MIT License
208 stars 89 forks source link

fix: potential scroll when scrollcontroller not attached #69

Closed jayjah closed 3 years ago

jayjah commented 3 years ago

Fix potential scroll when scrollcontroller is currently not attached.

That's the corresponding stacktrace:

The following assertion was thrown during a scheduler callback:
ScrollController not attached to any scroll views.
'package:flutter/src/widgets/scroll_controller.dart':
Failed assertion: line 108 pos 12: '_positions.isNotEmpty'

When the exception was thrown, this was the stack: 
#2      ScrollController.position (package:flutter/src/widgets/scroll_controller.dart:108:12)
#3      _WeekViewState.scrollToInitialTime (package:flutter_week_view/src/widgets/week_view.dart:199:49)
#4      ZoomableHeadersWidgetState.scheduleScrollToInitialTime.<anonymous closure> (package:flutter_week_view/src/widgets/zoomable_header_widget.dart:162:41)
#5      SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144:15)
#6      SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1090:9)
Skyost commented 3 years ago

Good ! :wink: