Skip to content

[bug] Closing the page will cause this package to fail #15

@alireza-hnzpv

Description

@alireza-hnzpv

hi,
I used IntroStepBuilder in different pages of my app. And in order to explain all my pages, I need to move through the pages with Get.to( ()=> NewPage()) like:

IntroStepBuilder(
        order: 15,
        overlayBuilder: (StepWidgetParams params) => IntroWidget( //my custom card intro widget
          introText[14],
          params,
          previousCallBack: () async{ //when client click on previous button
               Get.back();
               await Future.delayed(Duration(seconds: 1));
               params.onPrev!();
          }
          nextCallBack: () async { //when client click on next button
             Get.to( ()=> NewPage());
             await Future.delayed(Duration(milliseconds: 1000));
             params.onNext!();
          },
        ),
        builder: (context, key) => Container(
          key: key,
          child: ....
         )
    )

Now I want to close the existing page and go back to the main page and enter another page from there.
The first problem is that you have to delay the code params.onNext!(); run Because the full page is not loaded. I think it should have a listener to load the next IntroStepBuilder whenever the full page is loaded. The next problem is that Get.back(); It causes the code params.onNext!(); have the following error

E/flutter ( 4333): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
E/flutter ( 4333): #0 Element.widget (package:flutter/src/widgets/framework.dart:3474:31)
E/flutter ( 4333): #1 debugCheckHasMediaQuery. (package:flutter/src/widgets/debug.dart:296:17)
E/flutter ( 4333): #2 debugCheckHasMediaQuery (package:flutter/src/widgets/debug.dart:311:4)
E/flutter ( 4333): #3 MediaQuery._of (package:flutter/src/widgets/media_query.dart:1169:12)
E/flutter ( 4333): #4 MediaQuery.of (package:flutter/src/widgets/media_query.dart:1165:12)
E/flutter ( 4333): #5 Intro._render (package:flutter_intro/flutter_intro.dart:199:30)
E/flutter ( 4333): #6 _TargetEditorPageState.build.. (package:habi/app/pages/basePages/targetEditorPage.dart:309:27)
E/flutter ( 4333):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions