Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Flutter aligning GridView widget

so i want to put my Gridview.count widget in bottomCenter of my app.
As you can see, my Text widget arranges fine.I dont understand the difference beetwen those two.

What should i read or what mistake am i doing?

That’s how it looks :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

what i have

body: Stack(
          children: <Widget>[
            Align(
              alignment: Alignment.bottomCenter,
              child: GridView.count(
                crossAxisCount: 4,
                children: const [
                  MyButton(myIcon: Icon(Icons.add), myColor: Colors.red),
                  MyButton(myIcon: Icon(Icons.remove), myColor: Colors.green),
                  MyButton(myIcon: Icon(Icons.adb), myColor: Colors.blue),
                  MyButton(myIcon: Icon(Icons.air), myColor: Colors.red),
                ],
              ),
            ),
            Align(
                alignment: Alignment.centerLeft,
                child: Text(_wynik.toString(),
                    style: GoogleFonts.overpass(
                        fontSize: 50,
                        backgroundColor: Colors.amber,
                        color: Colors.white))),
          ],
        )

>Solution :

add shrinkWrap: true to GridView

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading