skip to Main Content

I am using flutter Version 3.13.8. Previously When using SingleChildScrollview the content of the page was pushed above the keyboard and scroll was working good.

But then after update the content is hidden when keyboard is opened, e.g I cant see the text in TextFormFields they hide below keyboard
how can i fix this?

  resizeToAvoidBottomInset:true,

i have tried both true and false its not working for me either.

The Keyboard shoud push all TextFormFields above

Following is the structure i am using

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        const BackgroundImage(),
        Scaffold(
          resizeToAvoidBottomInset: false,
          backgroundColor: Colors.transparent,
          appBar: AppBar(
            automaticallyImplyLeading: false,
            backgroundColor: Theme.of(context).appBarTheme.backgroundColor,
            toolbarHeight: 42.0,
            title: Row(
              children: [
                GestureDetector(
                  child: Image.asset(
                    'assets/images/left_arrow_50.png',
                    color: const Color(0xfffc9e1e),
                    width: 30,
                  ),
                  onTap: () {
                    Get.back(closeOverlays: true);
                  },
                ),
                const SizedBox(
                  width: 20,
                ),
                const Text(
                  'Page',
                  style: TextStyle(color: Color(0xfffc9e1e), fontSize: 18),
                ),
              ],
            ),
          ),
          body: SafeArea(
            child: SingleChildScrollView(
              controller: ScrollController(),
              child: Padding(
                padding: const EdgeInsets.symmetric(horizontal: 12.0),
                child: Obx(() => Column(
    form data) ```

2

Answers


  1. if ur using a column try to put the crossisAlignment: CrossAxisAlignment.stretch
    or try to put the content in a sizedBox with a hieght of 110.h

    Login or Signup to reply.
  2. If you are using package "ScreenUtilInit" just add useInheritedMediaQuery: true, in mian.dart

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search