Skip to content

Is there a conflict between responsive_framework and flutter_screenutil?  #128

@yoer

Description

@yoer

My app runs on mobile, and uses both responsive_framework and flutter_screenutil.

In the app, there are two different designSize values for flutter_screenutil in two widgets (home page and live page).

when switching back from the screen with a different designSize (live page),
I reset the previous screen's (home page) designSize using ScreenUtil.init.

However, some elements in certain areas(user id part) of the home page interface are partially reduced in size.
img_v2_e8c5de3f-5ba8-4e46-bfea-2c88f2f481ag
img_v2_5b324784-dccb-44d7-b792-bb3f764d2fbg

I suspect that some of the size judgments in responsive_framework may have been affected.
Is there a method in responsive_framework similar to ScreenUtil.init for resetting the screen size?

App:

  @override
  Widget build(BuildContext context) {
    return ScreenUtilInit(
      useInheritedMediaQuery: true,
      rebuildFactor: RebuildFactors.all,
      designSize: Size(390, 844),
      builder: (context, child) => MaterialApp(
        builder: (context, widget) => ResponsiveWrapper.builder(
          widget,
          maxWidth: 1200,
          minWidth: 428,
          defaultScale: true,
          breakpoints: [
            const ResponsiveBreakpoint.resize(428, name: MOBILE),
            const ResponsiveBreakpoint.autoScale(800, name: TABLET),
            const ResponsiveBreakpoint.resize(1000, name: DESKTOP),
          ],
        ),
        home: HomePage(),
      );
  }

HomePage -> LivePage

LivePage:

  @override
  Widget build(BuildContext context) {
    return ScreenUtilInit(
          designSize: const Size(750, 1334),
          minTextAdapt: true,
          splitScreenMode: true,
          builder: (context, child) {
            return Container();
          },
        );
  }
        
  @override
  void dispose() {
    super.dispose();
  
   ScreenUtil.init(...);
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions