Skip to content

'controller != null' errorΒ #597

@basvdijk

Description

@basvdijk

Describe the bug

With the new structure in v5 I get these kind of errors now and then

════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building Expanded(flex: 1):
Please register [ShowcaseView] first by calling [ShowcaseView.register()]
Failed assertion: line 177 pos 7: 'controller != null'

This is probably because there seems to be no way to detect if the controller is loaded. So it happens that the guidedtour starts when the showcaseview does not have its controller ready.

Maybe the register function should be async or have a callback when ready so you know it is safe to start the tour.

To Reproduce
Steps to reproduce the behavior:

  @override
  void initState() {
    super.initState();

    ShowcaseView.register(
      disableMovingAnimation: true,
      onFinish: () {
        guidedTourCompleter.complete();
      },
    );

    WidgetsBinding.instance.addPostFrameCallback((_) {
      startGuidedTour();
    });
  }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions