0

Flutter - 在屏幕上构建应用程序输出后,Gridview 部分在我的屏幕上不可见 控制台输出: 控制台输出 仅按钮部分可见,但不可见 gridview 部分。有人可以建议做些什么改变..这是代码: -

body: Column(
        mainAxisAlignment: MainAxisAlignment.start,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          Flexible(
              child: GridView.builder(
            padding: EdgeInsets.all(20),
            gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
              crossAxisCount: 3,
              childAspectRatio: 1.0,
              crossAxisSpacing: 10.0,
              mainAxisSpacing: 10.0,
            ),
            itemCount: this.gameState.length,
            itemBuilder: (context, index) {
              SizedBox(
                width: 50,
                height: 50,
                child: MaterialButton(
                  onPressed: () {
                    this.playGame(index);
                  },
                  child: Image(
                    image: this.getImage(this.gameState[index]),
                  ),
                ),
              );
            },
          )),
          Container(
            padding: EdgeInsets.all(20),
            child: Text(this.message),
          ),
          MaterialButton(
            onPressed: () {
              this.reset();
            },
            child: Text('Reset',
                style: TextStyle(
                  color: Colors.white,
                )),
            color: Colors.black,
          ),
        ],
      ),
4

0 回答 0