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

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

Open
alireza-hnzpv opened this issue Dec 28, 2023 · 0 comments
Open

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

alireza-hnzpv opened this issue Dec 28, 2023 · 0 comments

Comments

@alireza-hnzpv
Copy link

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):

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

1 participant