xxxxxxxxxx
Image.asset(
'assets/images/file-name.jpg',
scale: 0.8
)
xxxxxxxxxx
Image.asset(
'assets/images/file-name.jpg',
height: 100,
width: 200,
fit: BoxFit.fitWidth,
)
xxxxxxxxxx
Image.asset(
'assets/images/file-name.jpg',
height: 100,
width: 100,
)
xxxxxxxxxx
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Welcome to Flutter',
home: Scaffold(
appBar: AppBar(
title: Text('Flutter Image Tutorial'),
),
body: Center(
child: Container(child: Image.asset('assets/images/file-name.jpg'))
),
),
);
}
}