flushbar
flushbar copied to clipboard
[Question] Is there a way to limit the general height?
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);
}
I just went in and modified the things I needed and all is well.
@MostHated could you specify how you did that?
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 That'd be really helpful, thanks!
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 Found anything?