Skip to content

Modal Bottom sheet doesn't resize correctly #24

@SpencerLindemuth

Description

@SpencerLindemuth

If I use a modal bottom sheet like below,

await showModalBottomSheet(
      context: context,
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.vertical(top: Radius.circular(25.0))
      ),
      backgroundColor: Colors.transparent,
      builder: (BuildContext context) {
        return ResponsiveWrapper.builder(
             Container(),
             breakpoints: [...]
       );
);

The content becomes centered instead of aligning top like it does normally. Also I use bottom sheets with inputs which I float above the on screen keyboard using isScrollControlled = true to enable it to take up more than 50% of the screen, but with the ResponsiveWrapper it covers the entire screen and centers the child. I think this is because ResponsiveWrapper.builder technically returns a Stack with alignment:center but is there a way to keep the native flutter experience here of top aligning and shrinkwrapping height in modalBottomSheet?

Here are some photo examples:
Without responsive builder the bottom sheet wraps content
noKeyboard

Without responsive and with the keyboard open it hovers just over the keyboard (because isScrollControlled = true) and wraps content
withKeyboard

With responsive builder it expands to cover the entire screen
withoutKeyboardResponsive
withKeyboardResponsive

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions