Home > Back-end >  Flutter / how can i set border to container like samsung one ui app icon
Flutter / how can i set border to container like samsung one ui app icon

Time:08-15

I want to set the border of the container, something similar to the photo below

enter image description here

CodePudding user response:

I think the ratio of circular border is 4. try to modify if needed.

 Container(
  decoration: BoxDecoration(
    borderRadius: BorderRadius.circular(100 * .4),
    color: Colors.green,
  ),
  width: 100,
  height: 100,
),

enter image description here

Also, height is little increased on your attached image, modify it the way like

CodePudding user response:

Container(
 decoration: BoxDecoration(
  borderRadius: BorderRadius.circular(100 * .4),
  color: Colors.green,
 ),
 width: 100,
 height: 100,
 child: const Icon(
  Icons.phone,
  size:50,
  color:Colors.white,
 ),
),

That's all u can use like this. enter image description here

  • Related