Loading Image From Http Url
Complete Code For Loading Image From Http Url In Flutter
Main.dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
backgroundColor: Colors.black,
appBar: AppBar(
backgroundColor: Color(0xFF4527A0),
title: Text('Show Image from URL'),
),
body:Center(
child: Padding(
padding: const EdgeInsets.only(top:60.0),
child: Column(
children: [
Image.network('https://flutter-examples.com/wp-content/uploads/2020/02/dice.jpg',
width: 300, height: 200, fit: BoxFit.contain,),
SizedBox(height: 20,),
Image.network('https://flutter-examples.com/wp-content/uploads/2020/02/dice.jpg',
width: 300, height: 200, fit: BoxFit.contain,),
],
),
),
)));
}
}