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

First step message does not disappear #37

Closed
OUDON opened this issue Apr 23, 2022 · 2 comments
Closed

First step message does not disappear #37

OUDON opened this issue Apr 23, 2022 · 2 comments

Comments

@OUDON
Copy link

OUDON commented Apr 23, 2022

Thank you for this awesome library.

When I use combine this library with gen_l10n, a first step message does not disappear.
There are any way to set messages from context?

Code

  @override
  void didChangeDependencies() {
    super.didChangeDependencies();
    _startTutorial();
  }

  void _startTutorial() async {
    SharedPreferences pref = await SharedPreferences.getInstance();
    if (pref.getBool("showTutorial") ?? true == false) return;

    intro = Intro(
      stepCount: 6,
      maskClosable: true,
      widgetBuilder: StepWidgetBuilder.useDefaultTheme(
        texts: [
          AppLocalizations.of(context)!.tutorialSelectMusic,
          AppLocalizations.of(context)!.tutorialSetPointA,
          AppLocalizations.of(context)!.tutorialSetPointB,
          AppLocalizations.of(context)!.tutorialRepeatOn,
          AppLocalizations.of(context)!.tutorialSlide,
          AppLocalizations.of(context)!.tutorialAD,
        ],
        buttonTextBuilder: (currPage, totalPage) {
          return currPage < totalPage - 1
              ? AppLocalizations.of(context)!.tutorialButtonNext
              : AppLocalizations.of(context)!.tutorialButtonFinish;
        },
      ),
    );

    Timer(
      const Duration(
        milliseconds: 500,
      ),
      () {
        intro.start(context);
      },
    );
    pref.setBool("showTutorial", false);
  }

pubspec.yaml

dependencies:
  flutter_intro: ^2.3.1

Screenshots

1st step.
1st step

2nd step. but 1st step message does not disappeared.
2nd step

3rd step. 2nd step message disappeared, and 1st step message does not disappeared.
3rd step

@OUDON
Copy link
Author

OUDON commented Apr 23, 2022

I have solved this issue. Instead of direct approach, I decided to use easy_localize that can localize without BuildContext. Thank you.

@OUDON OUDON closed this as completed Apr 23, 2022
@hellohejinyu
Copy link
Member

image

1650719008679335.mp4

Hi, glad you finally found a solution.However, according to your description, I did not reproduce the abnormal situation you mentioned.Can you provide me with a reproducible demo if it is convenient? thanks.

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

2 participants