简体   繁体   中英

How to make the border of a Container two-colored in flutter?

Flutter uses the two-colored warning Containers when a Renderflex is overflowing. However is it possible to color the border of a Container in that way in my flutter app?

Container(
  decoration: BoxDecoration(
    border: Border.all(color: Colors.yellow .... Colors.black)   <--- somehow (?)
  ),
  child: Text('My border')
}

在此处输入图片说明

You can do this with Gradient or Custom Paint. There is an example like that

How to create a background with stripes in Flutter

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