Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widget tree rebuild when keyboard show #512

Closed
Hvt261 opened this issue Aug 24, 2023 · 27 comments
Closed

Widget tree rebuild when keyboard show #512

Hvt261 opened this issue Aug 24, 2023 · 27 comments

Comments

@Hvt261
Copy link

Hvt261 commented Aug 24, 2023

I used screenUtil from old version to current version (5.9.0)
When keyboard show, widget tree was rebuild.
When I remove SreenUtil lib, it worked normally.

Flutter 3.10.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 796c8ef792 (2 months ago) • 2023-06-13 15:51:02 -0700
Engine • revision 45f6e00911
Tools • Dart 3.0.5 • DevTools 2.23.1

@Mounir-Bouaiche
Copy link
Collaborator

Mounir-Bouaiche commented Aug 24, 2023

@Hvt261 Not the widget tree, but the widgets you declared see README.md file. We're listening to MediaQuery changes in core, so rebuilds on screen changes depends on core MediaQuery functionnality. Some improvements are planned by the end of Sep, but it will be a minor version.

@Hvt261
Copy link
Author

Hvt261 commented Aug 24, 2023

@Mounir-Bouaiche I removed all sources which have MediaQuery but error still happen
I wrap ScreenUtilInit out of MaterialApp.

@Mounir-Bouaiche
Copy link
Collaborator

Mounir-Bouaiche commented Aug 24, 2023

@Mounir-Bouaiche I removed all sources which have MediaQuery but error still happen I wrap ScreenUtilInit out of MaterialApp.

The libarary uses MediaQuery, not you. You can't change this behaivior, it's a core functionnality. If you have better options for listening to screen changes other than MediaQuery we can suggest that, you're welcome to open a pull request.

@AsadMoulviDev
Copy link

Hello, my app crashes every time i open the keyboard, I removed ScreenUtilInit and it solved the problem. I think the way I used ScreenUtilInit is wrong please help.

`class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

@OverRide
Widget build(BuildContext context) {
return ScreenUtilInit(
useInheritedMediaQuery: true ,
designSize: const Size(390, 844), // Set your design size here
builder: (_ , child) {
return MultiProvider(
providers: [
ChangeNotifierProvider(create: (context) => UserModel()),
ChangeNotifierProvider(create: (context) => EmailProvider()),
ChangeNotifierProvider(create: (context) => QuestionProvider()),
ChangeNotifierProvider(create: (context) => QuizSessionsProvider()),
ChangeNotifierProvider(create: (context) => AnalyticsProvider()),
ChangeNotifierProvider(create: (context) => DailyQuestionStreakProvider()),
ChangeNotifierProvider(create: (context) => GameProvider()),
ChangeNotifierProvider(create: (context) => IconSelectionProvider())
],
child: MaterialApp.router(
theme: ThemeData(
scaffoldBackgroundColor: const Color(0xFF333863),
textTheme: GoogleFonts.nunitoTextTheme(Theme.of(context).textTheme),
bottomNavigationBarTheme: BottomNavigationBarThemeData(
backgroundColor: AppColors.bg_color,
selectedItemColor: Colors.white,
unselectedItemColor: Colors.grey,
),
),
debugShowCheckedModeBanner: true,
routerConfig: AppRouter.createRouter(),
),
);
},
);
}
}`

@fuadreza
Copy link

fuadreza commented Aug 30, 2023

Yeah this also happen to me. My text got bigger when on screen keyboard pops up

@WeicongLi124
Copy link

There is also a problem with mine. When using 5.9.0, the keyboard will pop up and push the entire page up

@github-actions
Copy link

github-actions bot commented Oct 8, 2023

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Oct 8, 2023
@WeicongLi124
Copy link

WeicongLi124 commented Oct 8, 2023 via email

@github-actions github-actions bot removed the stale label Oct 9, 2023
@fisforfaheem
Copy link

I am having same issues on forms when keybaord opens all text gone

@xalikoutis
Copy link

try solution from this comment
#495 (comment)

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Nov 16, 2023
@WeicongLi124
Copy link

WeicongLi124 commented Nov 16, 2023 via email

@github-actions github-actions bot removed the stale label Nov 17, 2023
@abdullah432
Copy link

I'm getting same issue

@WeicongLi124
Copy link

WeicongLi124 commented Dec 1, 2023 via email

@fisforfaheem
Copy link

fisforfaheem commented Dec 1, 2023 via email

@aman246149
Copy link

try solution from this comment #495 (comment)

Thanks it work for me

@WeicongLi124
Copy link

WeicongLi124 commented Dec 24, 2023 via email

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Jan 24, 2024
@WeicongLi124
Copy link

WeicongLi124 commented Jan 24, 2024 via email

@github-actions github-actions bot removed the stale label Jan 25, 2024
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Feb 25, 2024
@WeicongLi124
Copy link

WeicongLi124 commented Feb 25, 2024 via email

@github-actions github-actions bot removed the stale label Feb 26, 2024
@fisforfaheem
Copy link

fisforfaheem commented Feb 26, 2024 via email

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Mar 28, 2024
@WeicongLi124
Copy link

WeicongLi124 commented Mar 28, 2024 via email

@github-actions github-actions bot removed the stale label Mar 29, 2024
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Apr 28, 2024
@WeicongLi124
Copy link

WeicongLi124 commented Apr 28, 2024 via email

@github-actions github-actions bot removed the stale label Apr 29, 2024
@Mounir-Bouaiche Mounir-Bouaiche closed this as not planned Won't fix, can't repro, duplicate, stale May 27, 2024
@WeicongLi124
Copy link

WeicongLi124 commented May 27, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants