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: hideBottomOnKeyboard just switch the visibility but doesn't free space #212

Closed
rekire opened this issue Mar 9, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@rekire
Copy link

rekire commented Mar 9, 2024

Describe the bug

I added a login into my introduction where I'm running out of space on smaller screens. The point is that when I set the flag the navigation is hidden, but is still allocating space. In my case the login button is cut off.

To Reproduce
Steps to reproduce the behavior:

  1. Create a PageViewModel with two fields and a button.
  2. On small devices like the iPhone 7 the login button is cut off

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots
Screenshot

Smartphone (please complete the following information):

  • Device: iPhone7
  • OS: iOS 15.7.5
  • Version 3.1.12

Additional context
Out of my view you should refactor the sizing of the elements. It is quiet complex to make it working with the flex weights.

Sample code

IntroductionScreen(
      key: onboardingKey,
      globalBackgroundColor: Colors.white,
      allowImplicitScrolling: true,
      hideBottomOnKeyboard: true,
      dotsFlex: 4,
      globalHeader: AppBar(
        title: Text(LocaleKeys.app_title.tr()),
      ),
      pages: [
        PageViewModel(
          title: LocaleKeys.onboarding_legal_title.tr(),
          bodyWidget: RichText(
            textAlign: TextAlign.center,
            text: TextSpan(
              style: pageInfoStyle,
              children: [...],
            ),
          ),
          image: SvgPicture.asset(
            'assets/image.svg',
            height: 300,
            semanticsLabel: LocaleKeys.imageDescription.tr(),
          ),
          decoration: pageDecoration,
        ),
        PageViewModel(
          title: LocaleKeys.login_title.tr(),
          bodyWidget: const SizedBox.shrink(),
          footer: SingleChildScrollView(
            child: Padding(
              padding: const EdgeInsets.symmetric(horizontal: 24),
              child: SingleChildScrollView(child: LoginWidget()),
            ),
          ),
          decoration: pageDecoration.copyWith(
            bodyFlex: 1,
            footerFlex: 5,
            imagePadding: EdgeInsets.zero,
            contentMargin: EdgeInsets.zero,
            pageMargin: EdgeInsets.zero,
            titlePadding: EdgeInsets.zero,
            descriptionPadding: EdgeInsets.zero,
            footerPadding: EdgeInsets.zero,
            footerFit: FlexFit.tight,
            fullScreen: true,
          ),
        ),
      ],
      onDone: () => login(),
      back: const Icon(Icons.arrow_back),
      skip: const Text('Skip', style: TextStyle(fontWeight: FontWeight.w600)),
      next: const Icon(Icons.arrow_forward),
      done: const Text('Login', style: TextStyle(fontWeight: FontWeight.w600)),
      curve: Curves.fastLinearToSlowEaseIn,
      dotsDecorator: const DotsDecorator(
        activeSize: Size(22, 10),
        activeShape: RoundedRectangleBorder(
          borderRadius: BorderRadius.all(Radius.circular(25)),
        ),
      ),
    );
@rekire rekire added the bug Something isn't working label Mar 9, 2024
@Pyozer
Copy link
Owner

Pyozer commented Mar 23, 2024

The new version 3.1.13 allow to set a new parameter on PageViewModel.

You can try to set scrollViewKeyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag.
It should fix your issue.

@Pyozer Pyozer closed this as completed Mar 23, 2024
@benedict1986
Copy link

benedict1986 commented Jun 27, 2024

Hi @Pyozer , I tried to add scrollViewKeyboardDismissBehavior but seems like it does not work. Here is my code

class CreatePageViewModel extends PageViewModel {
  CreatePageViewModel({required BuildContext context})
      : super(
          title: 'Create',
          useScrollView: true,
          bodyWidget: buildBodyWidget(context: context),
          decoration: const PageDecoration(
            pageMargin: EdgeInsets.only(bottom: 0),
            footerPadding: EdgeInsets.only(bottom: 0),
          ),
          scrollViewKeyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
        );
}

image

Can you please take a look and see what could be wrong? Thank you

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

3 participants