Wednesday, May 18, 2022

Insert Image Using Asset or PC

 

Insert Image

Using

Asset or PC

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

Featured post

Compress Image With Show File Size & Resolution in Flutter

 Compress Image With Show File Size & Resolution  1.Multiple File Image Compress with file Size import 'dart:io' ; import 'p...

LightBlog