Adding in Pubspec.yaml :-
assets:
- asset/
Then
Adding in package a new Directory/Folder with
asset name and paste the image ( Visible on your screen)
import 'package:flutter/material.dart';
void main(){
runApp(MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text("App Bar Widget"),
backgroundColor: Colors.purple.withOpacity(.50),
),
body: Center(
child: Image(
image: AssetImage(
"asset/akshay.jpg"
), // AssetImage);),
), // Center
),
), 💪 // MaterialApp
}
No comments:
Post a Comment