dooboolab-community/flutter_calendar_carousel

Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.

thearithchhie opened this issue · 3 comments

../../../../../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_calendar_carousel-2.3.0/lib/flutter_calendar_carousel.dart:950:33: Error: Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null.

  • 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../../../../flutter/packages/flutter/lib/src/widgets/binding.dart').
    Try calling using ?. instead.
    WidgetsBinding.instance.addPostFrameCallback((_) {

I think #313 patch will work which is published in version 3.2.1.

Please try this and come back.

reproduced the issue with flutter 2.5.3
image

#313 will fix this but will break flutter 3.0

After upgrade the version this warning occurred #314