Skip to content

Calendar header handling animation controller incorrectly #23

Description

@UnicornaasTech

Hello,

It seems that _CalendarHeaderState causes the following exception:
flutter error: This widget has been unmounted, so the State no longer has a context (and should be considered defunct)

The fix:
1:
Move initialization of _controller to initState():
_controller=AnimationController(duration: _kExpand, vsync: this);

2: Move everything in consctructor to initState() (after setting the _controller):
_monthIndex = monthIndexFromTime(clock.now());
_easeInAnimation =
CurvedAnimation(parent: _controller, curve: Curves.easeIn);
_iconTurns = Tween(begin: 0.0, end: 0.5).animate(_easeInAnimation);

HTH :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions