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

fix: Can not swipe until specific page using PageView/PageView.builder #331

Open
peer-f opened this issue Aug 17, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@peer-f
Copy link

peer-f commented Aug 17, 2023

Description

Hi,

first of all thank you for this providing this great tool.
We have a fairly big codebase that we want to cover using fluttium.

I have an issue where I'm unable to swipe until a specific page inside of my PageView. Each page consists out of a couple of assets and Text. Above this content there is a button floating using a Stack. The screen is used as an introduction screen to the app.

class IntroductionScreen extends HookConsumerWidget {
  const IntroductionScreen({super.key});

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final state = ref.watch(introductionControllerProvider);

    const steps = [
      const IntroductionStep1(),
      const IntroductionStep2(),
      const IntroductionStep3(),
      const IntroductionStep4(),
    ];

    return PlatformWidget(
      web: const IntroductionWebScreen(),
      app: Scaffold(
        extendBodyBehindAppBar: true,
        backgroundColor: context.color.orange,
        body: Stack(
          alignment: Alignment.bottomCenter,
          children: [
            Padding(
              padding: const EdgeInsets.only(bottom: 50),
              child: Semantics(
                label: 'page_view_builder',
                child: PageView.builder(
                  itemBuilder: (context, index) => steps.elementAt(index),
                  itemCount: steps.length,
                  controller: state.pageController,
                  onPageChanged: (index) =>
                      ref.read(introductionControllerProvider.notifier).changeCurrentStep(index),
                ),
              ),
            ),
            Column(
              mainAxisSize: MainAxisSize.min,
              crossAxisAlignment: CrossAxisAlignment.stretch,
              children: [
                PrimaryTextButton(
                  onPressed: () => ref.read(navigationControllerProvider).open(Screen.investment()),
                  text: 'Go to investment screen',
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}
description: Journey flow test.
---
- log: "Test Introduction Screen"
- expectVisible: "page_view_builder"
- swipe:
    in: "page_view_builder"
    until: "IntroductionStep4"
    direction: right
- takeScreenshot: './screenshots/introduction_completed.png'
- pressOn: "Go to investment screen"
- wait:
    seconds: 5

Steps To Reproduce
The swiping itself works and the the "page_view_builder" label is found but after that
the flow will get stuck and quit from there.

Expected Behavior

I have provided the name of the page that I want to swipe to. I'm not able to swipe until the page is reached even when wrapping the last page with a Semantics widget. One of these two options should work as far as I understand.

Additional Context

I have also tried using a PageView, moving the steps out of the variable, removing the Stack entirely and so on. The issue persists when using the scroll interaction.

@peer-f peer-f added the bug Something isn't working label Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant