Malak
Malak

Reputation: 441

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 :

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))),
          ],
        )

Upvotes: 0

Views: 43

Answers (1)

Andryot
Andryot

Reputation: 36

add shrinkWrap: true to GridView

Upvotes: 2

Related Questions