skip to Main Content

this is my issue:

I have a GridView.count with a List.generate as children.
Basically I have a grid of maps made with google_maps_flutter and I want to give each of them a corner radius but it applies only to the last element of my list , I’ve tried putting corner radius everywhere:

  1. inside a box decoration wrapping my elements inside a container, various tries never worked.
  2. wrapping in a clipRRect, still applies only for the last element.
  3. giving to my custom widget Map a corner radius, still applies only for the last element.

I think it is a render problem, when I run my app on a physical device and not the simulator, it works well for every cell in android, but in iOS there is still the problem. please help.
problem

start of the list

I want all the cells to have a border radius

code

2

Answers


  1. Try using clipBehavior

    ClipRRect{
      clipBehavior: Clip.antiAliasWithSaveLayer,
      child: ...
    }
    
    Login or Signup to reply.
  2. Try this

    Card(
      clipBehavior: ...,
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(8),
      ),
    ......
    )
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search