set assets image to file() code example
Example 1: flutter assets stackoverflow
flutter:
uses-material-design: true
assets:
- assets/images/lake.jpg
Example 2: flutter asset image not showing
flutter:
uses-material-design: true
assets:
- assets/
class _UserLoginState extends State<UserLogin> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: <Widget>[
Image(image: AssetImage("assets/christmas.jpeg"),
fit: BoxFit.cover,
],
)
);
}
}