I have a LazyVGrid with 2 columns in my ContentView. I want to add full width item on every n'th index of the grid. In this code snippet I am trying to add full width item only in the 2nd position for testing. How can I achieve this ? Thanks in advance
`LazyVGrid(columns: [GridItem(.flexible()), GridItem(.flexible())], alignment: .center) {
ForEach(0..<10, id: \.self) { index in
if index == 2 {
Text("Full Width Item")
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 100)
.background(Color.gray)
.foregroundColor(.white)
.cornerRadius(8)
.padding()
} else {
Text("Regular Item")
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 50)
.background(Color.green)
.foregroundColor(.white)
.cornerRadius(8)
.padding()
}
}
}`