Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When try to switch to another month with HeaderButton got the error - "The method 'call' was called on null." #242

Closed
awaik opened this issue Oct 12, 2020 · 8 comments

Comments

@awaik
Copy link

awaik commented Oct 12, 2020

Thank you for the cool plugin!

Version of flutter_calendar_carousel

flutter_calendar_carousel: ^1.5.0

Expected behavior

Screenshot 2020-10-12 at 16 31 11

When we tapped on the header we should go to another month (week).

Actual behavior

Nothing happens, got the error in the console

The method 'call' was called on null.
Receiver: null
Tried calling: call()

flutter doctor result (run flutter doctor in terminal)

[✓] Flutter (Channel stable, 1.22.0, on macOS 11.0 20A5384c, locale en-RU)
    • Flutter version 1.22.0 at /Users/macbook/development/flutter
    • Framework revision d408d302e2 (13 days ago), 2020-09-29 11:49:17 -0700
    • Engine revision 5babba6c4d
    • Dart version 2.10.0

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/macbook/Library/Android/sdk
    • Platform android-30, build-tools 29.0.3
    • 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-6222593)
    • All Android licenses accepted.

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

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 50.0.1
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

Steps to reproduce the behavior

Just run the example https://github.com/dooboolab/flutter_calendar_carousel/blob/master/example/lib/main.dart

@awaik awaik changed the title When try to switch to another month got the error - "The method 'call' was called on null." When try to switch to another month with HeaderButton got the error - "The method 'call' was called on null." Oct 12, 2020
@thebertozz
Copy link

I have this problem too, but even downgrading to a version that worked before (i was using the 1.4.12) causes the same issue... i think it has to do with the latest flutter update (1.22)

@awaik
Copy link
Author

awaik commented Oct 13, 2020

Yes, I also tried to downgrade the plugin, it didn't help. So, the issue is connected with the new version of Flutter.

@thebertozz
Copy link

I also tried to implement the onLeftButtonPressed and onRightButtonPressed and checked what the library does; in this way the header changes the month indication but the calendar doesn't show the correct days, setDate is never called because apparently _pageNum is always zero

The condition is this

this._pageNum > 0 ? _setDate(this._pageNum - 1) : null;

@porygon34
Copy link

Any updates on this? having the same issue. Anyone know of a work around for the time being?

@kokpheng
Copy link

kokpheng commented Oct 15, 2020

I already fixed the issue and wait for the request is merged. The temporary way is needed to manually modify the source code in your project.

See the file changed in #243

@thebertozz
Copy link

Thanks! I already tried that but i noticed that while the header correctly switches months back and forth, the calendar stays in the initial month without moving, because it seems that _pageNum is always 0. Am i missing something from your fix?

@awaik
Copy link
Author

awaik commented Oct 17, 2020

Well done, checked in my app, it works.

@awaik
Copy link
Author

awaik commented Oct 17, 2020

I'm not sure, who should close the issue, for me as the starter, the issue is resolved.

@awaik awaik closed this as completed Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants