Questions tagged [flutter-assetimage]

40 questions
6
votes
2 answers

Flutter : The argument type 'Image' can't be assigned to the parameter type 'IconData'

I want to use my image from assets as an icon, and then I build my lists, but there are some errors that occurred when trying to add Image.asset as a class to the icon as a variable with IconData as data type, instead of using Icons as a class. Any…
dexdim
  • 185
  • 1
  • 4
  • 11
4
votes
1 answer

Flutter - Asset images in package dependencies

We have the following structure: Package A is a flutter app, It has it's assets folder and is loading assets like this: Image.asset("assets/images/background.png"). project B, that uses package A as dependency. When I run package A from Project B,…
3
votes
2 answers

asset images not showing in release version of app in flutter?

I have made a list of images and using ListView.builder to display the images and its working perfectly fine while debugging and even in debug apk of the app but when i use release apk its not showing the images. List act = [ …
user14001097
2
votes
0 answers

Flutter : Loading asset image

I've got a problem when I load some asset images in flutter. In fact, I use my pictures in a carousel. When I load the images, there is a (very) small loading time where the image is white. That's not really a problem but when I scroll through the…
2
votes
1 answer

How to organize the images in the assets folder such in a way if we refactor developers dont need to change it every where

Guess I have a flutter project with assets in the following folder structure assets -> images -> img1.png img2.png ... So assume I am using this img2.png in multiple files in my flutter project, and after some time I change the assets folder…
codmytsvg
  • 35
  • 4
2
votes
1 answer

Flutter. Image rounded borders not working

I'm trying to make rounded corners of image. Here is my code: ClipRRect( borderRadius: BorderRadius.circular(14), child: Image.asset( …
2
votes
3 answers

Resolution aware images not working - Flutter

I am trying to add resolution aware image markers to google maps by converting each image to bitmap as such: static Future makeBitmapDescriptor(String path) { return BitmapDescriptor.fromAssetImage( …
Shaveen
  • 175
  • 2
  • 12
2
votes
2 answers

Flutter Positioned Widget not fixed depending size screen

My problem concerns the Positioned Widget. I'd like to position Widgets that match with an ExactAssetImage location of a Container. The context is to apply a PDF sheet to mobile with many assets with a RadioButton/editText. The fact is, if I don't…
2
votes
5 answers

How to catch "Unable to load asset: assets/images/sample_img_url.png"

Is there any way to catch the "Unable to load asset: assets/images/sample_img_url.png" error in Flutter? What I am trying to do is load an asset image by providing its path(from API). But if I do not have an image that associates with the given…
1
vote
1 answer

Flutter asset files not loading after updating Flutter version

I have a Flutter project where I use some asset files such as images, fonts, and translations. I have defined them in my pubspec.yaml file like this: assets: - assets/ Until a few hours ago, everything was working fine. However, after updating my…
1
vote
1 answer

Why is my image an invalid argument on screen with "no host specified" when all my images are defined and included in assets?

I'm working on a shopping app for a school project, and I'm trying to get my product images to show up on the various product detail screens. I used some sample images from flutter's Shrine sample app as I followed their tutorial - so all of my…
1
vote
1 answer

how to assetimage flutter?

permission requested, here I have some code, which I want to ask, how do I change the shape of the "box" into several images. so when you first click it will change the image and it will fall, after the random response changes to the next…
1
vote
2 answers

Unable to load asset in Alert Dialog content

I know that there are a lot of thread related to this question but they didn't help. I have an asset folder containing images. Images are properly shown in other parts of the code but not in the Alert Dialog. In the example I use a .gif file, but I…
c4dado
  • 23
  • 4
1
vote
0 answers

Keeping an image file or Importing a package to get the image is expensive flutter

I am figuring out which one is more storage friendly when it comes to getting some icons which are not available in the flutter icons module. So, there are two ways to do it Get your icons as assets, store in the app, and then use it wherever you…
Alok
  • 8,452
  • 13
  • 55
  • 93
1
vote
0 answers

AssetImage Image Not showing

Somehow I cannot load an image into my app. Can you please help? Added the directory into pubspec.yaml Container( height: MediaQuery.of(context).size.height / 3.8, child: Stack( children: [ …
1
2 3