import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';

class Exo1 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Image',
      home: Scaffold(
        appBar: AppBar(
          leading: BackButton(onPressed: () => Navigator.of(context).pop()),
          title: Text('Example')),
        body: LayoutBuilder(builder: (context, constraints) {
          return Center(
            child: Image.network('https://picsum.photos/512/1024',
              width: constraints.maxHeight,
              height: constraints.maxWidth,
              fit: BoxFit.contain,
            )
          );
        })
      )
    );
  }
}
