How to Show an Image from a URL in Flutter

In this blog post, I will tell you how to display an image which loads from the internet in your Flutter app.

This flutter image example uses Image widget with constructor. Go through the code of main.dart given below:

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Welcome to Flutter',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Flutter Image Example'),
        //calling MyBody class
        body: Center(
          height: 400, width:  400,

The output of flutter image example is as given in the screenshot below:

I am showing an image from pixabay website with height and width of 400 pixels.

Leave a Comment

Your email address will not be published.