I am trying to display a picture but it didn't work well.
Asked
Active
Viewed 143 times
0
-
1Can you include your code-snippet instead of code-image? and what is `ImageOrnekleri()` – Md. Yeasin Sheikh Oct 07 '22 at 18:00
-
ı couldn't do snippet and also ImageOrnekleri()'s means(Ornekleri is turkısh ) ImageExamples() – muhammedgulsoy Oct 07 '22 at 18:14
-
1It is ok, but you need to include code-snippet in dart that will reproduce the error. More about [minimal-reproducible-example](https://stackoverflow.com/help/minimal-reproducible-example) – Md. Yeasin Sheikh Oct 07 '22 at 18:17
-
ı installed but didn't work now. my error is Exception caught by services library – muhammedgulsoy Oct 07 '22 at 18:19
-
1That is ok, Consider including error message with code-snippet(no code-image). More about [asking good question](https://stackoverflow.com/help/how-to-ask) – Md. Yeasin Sheikh Oct 07 '22 at 18:22
-
thank you and ı want something from you. when ı tried to run my program again,there were not any errror but there is a page which is image_provider.dart is appears in my screen and rethrow is filled yellow.ı am so confused.Whatever you say ı can show it is not problem – muhammedgulsoy Oct 07 '22 at 18:39
-
*rethrow is filled yellow* could be overflow issue. cant say for sure – Md. Yeasin Sheikh Oct 07 '22 at 18:40
-
what should ı show you to understand the error – muhammedgulsoy Oct 07 '22 at 18:41
-
You can include sample code-snippet and error message, if on UI include an image of output on question, then I might be able to get it – Md. Yeasin Sheikh Oct 07 '22 at 18:43
-
ı included it.. – muhammedgulsoy Oct 07 '22 at 18:53
-
Sorry not like this, code-snippet means the code you've written on VS Code. try to follow those previous links or others upvoted question – Md. Yeasin Sheikh Oct 07 '22 at 18:56
1 Answers
0
I guess this is what you're looking for.
body: Center(
child: Image.network(
'https://docs.flutter.dev/assets/images/dash/dash-fainting.gif', width: 200, height: 200,),
),
Here is the complete code.
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Home',
home: Scaffold(
appBar: AppBar(title: Text('Image ornekleri')),
body: Center(
child: Image.network(
'https://docs.flutter.dev/assets/images/dash/dash-fainting.gif', width: 200, height: 200,),
),
),
);
}
}
You can use Image.asset() if you have local image files as explained here

Tahir
- 170
- 10
-
-
you can use Image.asset() according to the method mentioned in the link in my answer. – Tahir Oct 08 '22 at 07:22
-
If you are running your application in `Release Mode` make sure to add `Internet Permission` in `Manifest File` – Ahmad hassan Oct 11 '22 at 10:12