0

I'm trying to use the material banner widget but a list of actions is required. The list of actions is causing the banner to look weird even when I place an empty container inside of the list.

Should I not be using the material banner widget since it requires a list when my design doesn't need a list of actions available? I want to use the widget since I can use these methods easily.

ScaffoldMessenger.of(context).showMaterialBanner & ScaffoldMessenger.of(context).clearMaterialBanners();

If I shouldn't be using the widget, does anyone else have a good replacement for it? Thank You.

Edit: I've added an image for reference. https://i.stack.imgur.com/Cw3hR.jpg I want to get rid of the red area on the right side of the banner. I've tried setting the material banner's padding to padding: EdgeInsets.zero

agelakute
  • 15
  • 3
  • please look at this answer and follow second way for Material Banner.https://stackoverflow.com/questions/64123839/flutter-remove-border-expansion-tile/64124471#64124471 – Sajjad Jan 08 '22 at 06:13

1 Answers1

0

I think I found a way but it's dirty: open the MaterialBanner widget and change everything you don't like in the code.

Below are the changes I made. After that, I'm passing any List of widgets as actions to the MaterialBanner, which is simply ignored.

Changes to MaterialBanner

user3705905
  • 86
  • 1
  • 3