Home > database >  Click on TextField rebuild whole UI in flutter
Click on TextField rebuild whole UI in flutter

Time:09-05

Click on TextField rebuild whole UI in flutter (When our screen one or more widget depend on Media Query) How I can solve this issue? This strange behavoiur of media query when we click on textfield and keyBoard open media query rebulid one more same page in stack.How I can solve this issue?

CodePudding user response:

Make useInheritedMediaQuer to true.This will help you to solve this issue

MaterialApp(
        useInheritedMediaQuery: true,)

CodePudding user response:

This is normal behavior.When you click on TextField and keyboard opens , the viewinsets value changes then your widget rebuild. Click here!

You can use MediaQuery.of(context) in seperated widget to prevent rebuild your whole widget for better performance.

  • Related