OpenFlutter / flutter_screenutil

Flutter screen adaptation, font adaptation, get screen information
https://pub.dartlang.org/packages/flutter_screenutil
Apache License 2.0
3.85k stars 486 forks source link

Widget tree rebuild when keyboard show #512

Closed Hvt261 closed 1 month ago

Hvt261 commented 11 months ago

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 commented 11 months ago

@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 commented 11 months ago

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

Mounir-Bouaiche commented 11 months ago

@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 commented 11 months ago

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 commented 10 months ago

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

WeicongLi124 commented 10 months ago

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[bot] commented 9 months ago

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

WeicongLi124 commented 9 months ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

fisforfaheem commented 9 months ago

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

xalikoutis commented 9 months ago

try solution from this comment https://github.com/OpenFlutter/flutter_screenutil/issues/495#issuecomment-1598513177

github-actions[bot] commented 8 months ago

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

WeicongLi124 commented 8 months ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

abdullah432 commented 7 months ago

I'm getting same issue

WeicongLi124 commented 7 months ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

fisforfaheem commented 7 months ago

Will this be Fixed? Or shall use something else

On Fri, Dec 1, 2023, 10:03 PM WeicongLee @.***> wrote:

这是来自QQ邮箱的假期自动回复邮件。

您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

— Reply to this email directly, view it on GitHub https://github.com/OpenFlutter/flutter_screenutil/issues/512#issuecomment-1836469463, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIRXJSBFAFXF6O5YPMVS4FDYHIEXDAVCNFSM6AAAAAA34TGQMKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZWGQ3DSNBWGM . You are receiving this because you commented.Message ID: @.***>

aman246149 commented 7 months ago

try solution from this comment #495 (comment)

Thanks it work for me

WeicongLi124 commented 7 months ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

github-actions[bot] commented 6 months ago

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

WeicongLi124 commented 6 months ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

github-actions[bot] commented 5 months ago

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

WeicongLi124 commented 5 months ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

fisforfaheem commented 4 months ago

Reply

On Sun, Feb 25, 2024, 6:47 AM WeicongLee @.***> wrote:

这是来自QQ邮箱的假期自动回复邮件。

您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

— Reply to this email directly, view it on GitHub https://github.com/OpenFlutter/flutter_screenutil/issues/512#issuecomment-1962783629, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIRXJSCPCINRAUU4LBA7ZYTYVKJ3ZAVCNFSM6AAAAAA34TGQMKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRSG44DGNRSHE . You are receiving this because you commented.Message ID: @.***>

github-actions[bot] commented 3 months ago

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

WeicongLi124 commented 3 months ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

github-actions[bot] commented 2 months ago

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

WeicongLi124 commented 2 months ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

WeicongLi124 commented 1 month ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。