Flutter - Gridview part is not visible on my screen after building the app

144 views Asked by At

Flutter - Gridview part is not visible on my screen after building the app output on screen Console Output: console output only the button part is visible but not the gridview part. Can someone suggest what changes to do.. Here is the code:-

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

There are 0 answers