0

I am trying to display a picture but it didn't work well.

2

1

Francesco - FL
  • 603
  • 1
  • 4
  • 25

1 Answers1

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