Flutter: How to fix “A RenderFlex overflowed by pixels ” error?

后端 未结 3 1183
青春惊慌失措
青春惊慌失措 2020-12-03 17:36

I am using GridView in my Flutter app to display images and their titles. Please check the below code.

import \'package:flutter/mat         


        
3条回答
  •  萌比男神i
    2020-12-03 18:06

    try to use Expanded instead of Container in _buildImageBoxes() function

      Widget _buildImageBoxes() {
        return Column(
          children: [
            Expanded(
              child: Image.network("https://picsum.photos/500/500/?random"),
            ),
            Container(
              padding: EdgeInsets.all(10),
              child: Text("Text"),
            )
          ],
        );
      }
    

提交回复
热议问题