xxxxxxxxxx
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
// Example image URL
String imageUrl = 'https://example.com/path/to/image.jpg';
return MaterialApp(
title: 'Flutter Image',
home: Scaffold(
appBar: AppBar(
title: Text('Adding Image'),
),
body: Center(
child: Image.network(
imageUrl, // Provide your own image URL or local file path
fit: BoxFit.cover, // Adjust the image size as per the container
),
),
),
);
}
}