flushbar icon indicating copy to clipboard operation
flushbar copied to clipboard

[Question] Is there a way to limit the general height?

Open MostHated opened this issue 4 years ago • 6 comments

Hey there, I am using this on desktop, so the dimensions of my app are a bit different (850w x 470h). The message ends up being super long, which I limited by using MediaQuery in the margin for left and right, then I used bottom margin to raise it up so it could be seen above the bottom menu, but it is still relatively taller than I would like and I am not quite sure how to go about limiting the height? Below is what I had setup so far.

Thanks, -MH

Flushbar showErrorToast(BuildContext context, String message) {
  return Flushbar(
    margin: EdgeInsets.fromLTRB(
      MediaQuery.of(context).size.width * 0.2,
      0,
      MediaQuery.of(context).size.width * 0.2,
      40,
    ),
    flushbarPosition: FlushbarPosition.BOTTOM,
    flushbarStyle: FlushbarStyle.FLOATING,
    leftBarIndicatorColor: Colors.black26,
    borderRadius: 8,
    title: 'Error',
    message: message,
    icon: Icon(
      Icons.error,
      size: 28.0,
      color: Colors.white,
    ),
    duration: const Duration(seconds: 4),
    backgroundGradient: LinearGradient(
      colors: [Colors.red[800], Colors.red[600]],
    ),
    onTap: (flushbar) => flushbar.dismiss(),
  )..show(context);
}

MostHated avatar May 25 '20 07:05 MostHated

I just went in and modified the things I needed and all is well.

MostHated avatar May 26 '20 20:05 MostHated

@MostHated could you specify how you did that?

welfvh avatar Jan 12 '21 15:01 welfvh

Shoot, it's been a while since I last had to mess with that application. I barely remember much about it, I would have to try and do some digging. I will try and carve out some time and see if I can remember what/where I made changes.

MostHated avatar Jan 12 '21 16:01 MostHated

@MostHated That'd be really helpful, thanks!

welfvh avatar Jan 12 '21 16:01 welfvh

Just one quick note on it, I am pretty sure I had to clone the repo, then added it to the project as a local package, and modified the source of it to get it to do what I wanted.

MostHated avatar Jan 12 '21 16:01 MostHated

@MostHated Found anything?

welfvh avatar Jan 14 '21 20:01 welfvh