Home > Back-end >  I want to design grid like this in flutter:
I want to design grid like this in flutter:

Time:01-22

I want to design a Grid like the below output in flutter. Please help with this.
expected Output

The Code I have tried is this:

Container(
           height: 100,
           width: 170,
           margin: const EdgeInsets.symmetric(horizontal: 30),
           child: DecoratedBox(
           decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(20),
              color: Colors.white,
              ),
              child: Container(
              decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(20),
              color: Colors.black
              ),
              margin: const EdgeInsets.all(1.5),
              child: const Center(
              child: Text(
              "data",
              style: TextStyle(color: Colors.white),
              ),
            ),
          ),
       ),
   ),

And the output I get is this:
enter image description here

Thanks in advance for your help.

CodePudding user response:

What you can do to maintain a grid is use Wrap.

Not very efficient for long list of items but for short it will suffice.

Take a look at the code below : ( You can run this code using Output Image

  •  Tags:  
  • Related