Bottom sheet responsive to the keyboard

    0

    1

    Mahmoud Mahmoud

    BottomSheet

    The showResponiveBottomSheet function will create a single child scrollview that is responsive to the parent's width and height. The container will be placed within the viewport, and the child will be a place-your-child-widget widget. The isScrollControlled property will be set to true so that the child will scroll as needed.

    Shortcut: keybtm

    Filename pattern: .dart

    void showResponiveBottomSheet(){
      showModalBottomSheet(
        context: context,
        isScrollControlled: true,
        builder: (BuildContext context) {
          return SingleChildScrollView(
              child: Container(
            padding: EdgeInsets.only(
                bottom: MediaQuery.of(context).viewInsets.bottom),
            child: PlaceYourChildWidget(),
          ));
        });
    }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.