0

Is my network image still overflowing, despite the defined width, and why?

Here is a problematic part of the code:

Container(
  height: 200,
  width: MediaQuery.of(context).size.width, // This may be helpful, but not in my case...
  decoration: BoxDecoration(
      image: DecorationImage(
      fit: BoxFit.fitWidth,
      image: NetworkImage("${module['thumbnail']}"),
      ),
   ),
),

How to fix overflow?

A RenderFlex overflowed by 28 pixels on the right.

Help, I am a newbie in Flutter. Thanks!

Ps. Updated code from top to problematic :

Widget build(BuildContext context) {
    return InkWell(
        onTap: () {
          Navigator.push(
            context,
            MaterialPageRoute(builder: (context) => SingleModule()),
          );
        },
        child: Card(
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(5.0),
          ),
          clipBehavior: Clip.antiAlias,
          child: Row(
            children: [
              Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Container(
                    height: 200,
                    width: MediaQuery.of(context).size.width,
                    decoration: BoxDecoration(
                      image: DecorationImage(
                        fit: BoxFit.cover,
                        image: NetworkImage("${module['thumbnail']}"),
                      ),
                    ),
                  ),
Milos N.
  • 4,416
  • 6
  • 18
  • 31

1 Answers1

0

Try putting padding: EdgeInsets.only(right: 28), to your Container that wrap around your Image Widget.

Keemo Kimo
  • 106
  • 1
  • 13