Codelessly / ResponsiveFramework

Easily make Flutter apps responsive. Automatically adapt UI to different screen sizes. Responsiveness made simple. Demo: https://gallery.codelessly.com/flutterwebsites/minimal/
https://codelessly.com
MIT License
1.25k stars 150 forks source link

ResponsiveScaledBox in showDialog does not work properly #161

Open ed-oo opened 10 months ago

ed-oo commented 10 months ago

Hello,

Very great job, this fix the draggable pointer problem, but i have a bug inside showDialog.

For this to work inside showDialog, ResponsiveScaledBox must be implemented like this:

showDialog(
    context: context,
    builder: (BuildContext context) => Listener(
      behavior: HitTestBehavior.translucent,
      child: ResponsiveScaledBox(
        width: ResponsiveValue<double>(context, conditionalValues: [
          Condition.between(start: 0, end: 2000, value: 1600),
        ]).value,
        child: child!,
      ),
    ),
    useSafeArea: true,
  );

The problem is that using MediaQuery.of(context).size doesn't give the right value with useSafeArea: true: I'm on an iPad Pro 11 inch 4th gen (without home button), the value given by "MediaQuery.of(context).size.height" inside "showDialog" is 834.0, if i use useSafeArea: false the "MediaQuery.of(context).size.height" is 1117.5879.

Can you fix this problem plz ?