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] Can't open on screen keyboard when showFlexibleBottomSheet based on content height is used #71

Closed
Ruslanbek0809 opened this issue Nov 2, 2022 · 3 comments
Labels
bug Something isn't working new issues

Comments

@Ruslanbek0809
Copy link

Thanks for the package. I can't open the on-screen keyboard when showFlexibleBottomSheet based on content height is used. Can you check and let me know if you get this issue as well?

@Ruslanbek0809 Ruslanbek0809 added the bug Something isn't working label Nov 2, 2022
@mark-kascheev
Copy link
Contributor

@Ruslanbek0809 Hello! What do you mean? Can you attach video for example?

@jcmtyler
Copy link

Hello, not sure if this is the same thing, but I also came here to report an issue with the on-screen keyboard when using showFlexibleBottomSheet 3.1.2 and Flutter 3.7.7. Attached is a short video showing how I open the bottom sheet, but then when the keyboard appears it completely blocks the sheet so I can't see what I'm typing. Here's my usage:

showFlexibleBottomSheet<void>(
      minHeight: 0,
      initHeight: 1.0,
      maxHeight: 1.0,
      isCollapsible: true,
      isExpand: false,
      context: ctx,
      builder: (BuildContext context, ScrollController scrollController, double bottomSheetOffset) {
        return ListView(
          controller: scrollController,
          shrinkWrap: true,
          padding: EdgeInsets.all(10.0),
          children: [
            Text(
              selectedDay.longDateOnly(),
              textAlign: TextAlign.center,
              style: Theme.of(context).textTheme.headlineSmall,
            ),
            ...events(appState, selectedDay),
            const SizedBox(height: 8.0),
            notes(context, appState, selectedDay),
          ],
        );
      },
      isSafeArea: true,
    );

flexible_bottom_sheet_blocked_by_keyboard_25mar2023

@internetova
Copy link
Collaborator

internetova commented Apr 3, 2023

@jcmtyler
Hi! If you are using BottomSheet hight of which is overlapped by the keyboard, it’s better to use custom BottomSheet from the framework.

Sample is below:

2023-04-03 14 20 33

class TestBottomSheet extends StatelessWidget {
  const TestBottomSheet({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            ElevatedButton(
              onPressed: () => showModalBottomSheet(
                context: context,
                builder: (_) => const _BottomSheet(),
                backgroundColor: Colors.amber,
              ),
              child: const Text('Open'),
            ),
          ],
        ),
      ),
    );
  }
}

class _BottomSheet extends StatelessWidget {
  const _BottomSheet({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return SingleChildScrollView(
      child: AnimatedPadding(
        padding: MediaQuery.of(context).viewInsets,
        duration: const Duration(milliseconds: 100),
        child: Container(
          height: 200,
          color: Colors.amber,
          child: Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              mainAxisSize: MainAxisSize.min,
              children: const <Widget>[
                Text('BottomSheet'),
                Padding(
                  padding: EdgeInsets.all(20.0),
                  child: ClipRRect(
                    borderRadius: BorderRadius.all(
                      Radius.circular(12.0),
                    ),
                    child: ColoredBox(
                      color: Colors.white,
                      child: TextField(
                        decoration: InputDecoration(
                          border: OutlineInputBorder(
                            borderRadius: BorderRadius.all(
                              Radius.circular(12.0),
                            ),
                          ),
                        ),
                      ),
                    ),
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new issues
Projects
None yet
Development

No branches or pull requests

6 participants