飘动的gridview小部件

发布于 2025-02-11 04:06:08 字数 1313 浏览 2 评论 0原文

因此,我想将我的 gridview.count 窗口小部件放在我的应用程序的底部中心中。 如您所见,我的 text 窗口小部件很好地安排了。我不明白这两个区别的差异。

我应该读什么或我在做什么错误?

这就是外观:

“我拥有的”

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最美不过初阳 2025-02-18 04:06:08

添加缩水:true到GridView

add shrinkWrap: true to GridView

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文