rflutter_alert icon indicating copy to clipboard operation
rflutter_alert copied to clipboard

Constraints does not work

Open armandojimenez opened this issue 3 years ago • 10 comments

When I use the constraints param, it does not take effect and it still takes the content width, looks weird on tablets

armandojimenez avatar Jun 15 '21 21:06 armandojimenez

Anyone know how to deal with this?

armandojimenez avatar Jun 25 '21 20:06 armandojimenez

+1

alihalabyah avatar Jul 03 '21 21:07 alihalabyah

@armandojimenez can you share your constraints added code?

ibrahimdevs avatar Aug 03 '21 15:08 ibrahimdevs

constraints: const BoxConstraints(maxWidth: 400),

Nothing I try works

armandojimenez avatar Aug 18 '21 15:08 armandojimenez

I was able to fix this by playing around with alertPadding in AlertStyle BoxConstraints width parameters still don't work, but the alert was able to fit full device width. You can control the width using alertPadding parameter in AlertStyle

Alert(
      context: context,
      style: AlertStyle(
        alertPadding: EdgeInsets.symmetric(horizontal: 20),

        // minWidth doesn't work
        constraints: BoxConstraints(
          minHeight: 0.6 * height,
          minWidth: 0.9 * width,
        ),
      ),
    );

AsjadSiddiqui avatar Nov 17 '21 06:11 AsjadSiddiqui

I was able to fix this by playing around with alertPadding in AlertStyle BoxConstraints width parameters still don't work, but the alert was able to fit full device width. You can control the width using alertPadding parameter in AlertStyle

Alert(
      context: context,
      style: AlertStyle(
        alertPadding: EdgeInsets.symmetric(horizontal: 20),

        // minWidth doesn't work
        constraints: BoxConstraints(
          minHeight: 0.6 * height,
          minWidth: 0.9 * width,
        ),
      ),
    );

With this the dialog does not full expand to the content width?

armandojimenez avatar Dec 08 '21 00:12 armandojimenez

The problem is with tablets, boxConstraints does not work for max height and width

armandojimenez avatar Dec 08 '21 00:12 armandojimenez

Is this going to be worked on? Its easy reproducible, the constraint param does not work, add a long text to the description param and use a tablet, the dialog will extend the width of the text

armandojimenez avatar Dec 16 '21 21:12 armandojimenez

IMG_0002

Example, the dialog is taking the width of the string passed to desc param, also happens with the title.

my constrain code: constraints: const BoxConstraints(maxWidth: 400),

Nothing works in terms of param.

armandojimenez avatar Dec 16 '21 21:12 armandojimenez

Hi,

I have the same issue. BoxContrains is not working

robertoltrocha avatar Apr 18 '22 20:04 robertoltrocha

@armandojimenez this will be fixed in next version: V2.0.6

ibrahimdevs avatar May 17 '23 09:05 ibrahimdevs