Why flutter UI lags when soft keyboard appears?

Viewed 41

I'm using flutter's latest version to create a bottom model sheet with a text field which is auto focused, so as soon as I click the button to show that bottom model the UI lags while soft keyboard appears. I've tried setting the following property to false, but still no luck.

Scaffold(
...
  resizeToAvoidBottomInset: false,
)

Here's the code bottom sheet is being called:

floatingActionButton: FloatingActionButton(
    onPressed: () async {
      showModalBottomSheet(
          isScrollControlled: true,
          context: context,
          builder: (context) => const TaskBottomSheet());
          }),

There's no lag until I make the soft keyboard appear in the screen. How can I fix this?

1 Answers

Did you try to run it in the profile or release mode? Flutter optimizes your app in these two modes.

flutter run --profile or flutter run --release
Related