Skip to content

Doesn't work in conjunction with device_preview library #62

@MenaRaafat

Description

@MenaRaafat

Using Responsive Framework alongside device_preview library produces a distorted UI.

Device_preview library:
https://pub.dev/packages/device_preview


void main() {
  // runApp(DevicePreview(
  //     enabled: true, //!kReleaseMode,
  //     plugins: [
  //       const ScreenshotPlugin(),
  //       const FileExplorerPlugin(),
  //       const SharedPreferencesExplorerPlugin(),
  //     ],
  //     builder: (context) => MyApp()));

  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Sizer(
      builder: (context, orientation, deviceType) {
        return MaterialApp(
          debugShowCheckedModeBanner: false,
          title: "MyAppTitle",
          color: Colors.yellow,
          home: Home(),
          builder: (context, widget) => ResponsiveWrapper.builder(
            BouncingScrollWrapper.builder(context, widget!),
            maxWidth: 2060,
            minWidth: 450,
            defaultScale: true,
            breakpoints: [
              ResponsiveBreakpoint.resize(450, name: MOBILE),
              ResponsiveBreakpoint.autoScale(800, name: TABLET),
              ResponsiveBreakpoint.autoScale(1000, name: TABLET),
            //  ResponsiveBreakpoint.resize(1200, name: DESKTOP),
            //  ResponsiveBreakpoint.autoScale(2460, name: "4K"),
            ],
          ),
        );
      },
    );
  }
}

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