dooboolab-community / flutter_calendar_carousel

Calendar widget for flutter that is swipeable horizontally. This widget can help you build your own calendar widget highly customizable.
MIT License
837 stars 307 forks source link

Method 'addPostFrameCallback' cannot be called on 'WidgetsBinding?' because it is potentially null. #307

Closed Huangfuzhimin closed 2 years ago

Huangfuzhimin commented 2 years ago

Version of flutter_calendar_carousel 2.2.0

build failed

image

Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.10.4, on macOS 12.0.1 21A559 darwin-x64, locale zh-Hans-CN) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✓] Xcode - develop for iOS and macOS (Xcode 13.4.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2020.3) [✓] IntelliJ IDEA Community Edition (version 2021.1.2) [✓] VS Code (version 1.64.0) [✓] Connected device (3 available)

sernocturno commented 2 years ago

this works for me... on the file C:\src\flutter.pub-cache\hosted\pub.dartlang.org\flutter_calendar_carousel-2.2.0\lib\flutter_calendar_carousel.dart

on the line 326 make this change

-- headerTitle: headerText ?? widget.weekFormat ? '${_localeDate.format(_weeks[_pageNum].first)}' : '${_localeDate.format(_dates[_pageNum])}',

++ headerTitle: headerText ?? (widget.weekFormat ? '${_localeDate.format(_weeks[_pageNum].first)}' : '${_localeDate.format(_dates[_pageNum])}'),

arnoorani commented 2 years ago

Any solution for this yet? it's causing the build to fail on flutter flutter version: 2.8.1

arnoorani commented 2 years ago

Version of flutter_calendar_carousel 2.2.0

build failed

image

Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.10.4, on macOS 12.0.1 21A559 darwin-x64, locale zh-Hans-CN) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✓] Xcode - develop for iOS and macOS (Xcode 13.4.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2020.3) [✓] IntelliJ IDEA Community Edition (version 2021.1.2) [✓] VS Code (version 1.64.0) [✓] Connected device (3 available)

were you able to solve this issue?

zitob9 commented 2 years ago

i have the same problem

arnoorani commented 2 years ago

This worked for me.

replace flutter_calendar_carousel with the following::

flutter_calendar_carousel: git: url: https://github.com/dooboolab/flutter_calendar_carousel ref: 0fa27175b360af3549a12ac1cf612b15eb75a2a

Screen Shot 2022-06-11 at 2 17 08 PM

f

Huangfuzhimin commented 2 years ago

I solved this problem : image