简体   繁体   中英

Is there a way to make a flutter widget to disobey scaffold padding?

My app screen has a lot of containers and according to the UX design, they're all supposed to be padded within the scaffold. Now there's one container that has the task of displaying error messages. I want just this container to occupy full width ie. not be padded.

Use the widget Stack as the root widget and put your scaffold inside. The container bellow will be displayed over the scaffold if it exists.

Stack(
  children: <Widget>[
    Scaffold(
          body:...
    ),  
    Container(
      constraints: BoxConstraints.expand(),
      decoration: BoxDecoration(
        color: Colors.red
      ),
    ),
  ],
),

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM