Maybe you could achieve it with LazyTable.
I would define an equal sized grid with that gap size and register item one-by-one with needed size and offset. However you have to calculate how many cells fit width, I guess BoxWithConstraint could help with this.
For example if gap is 16.dp, then get screen width and calculate number of cells, lets say it would be 19 cells for width. Then you may register that green box with offset 0x0 and size (19-1)/2=9 cells for width and height. The blue one would have 10x0 offset and 9x4 size, and so on.
Or alternatively you may take MinaBox and build your own layout on top of it 🐱
P.S.: If you precisely fit items in width, the horizontal scroll will be ignored (at least I hope so 😅).
#shameless-self-promo 😅
https://github.com/oleksandrbalan/lazytable
https://github.com/oleksandrbalan/minabox