How to know the nominal resolution of an image to use as an asset in flutter? - flutter

I have some photos of different sizes for different android and iOS devices. Like, a photo in 800x1280 resolution and in 540x960.
Flutter Docs say that if I place those photos in a proper way, Flutter will use the best suiting one to my device as an asset. But how should I place them? Which resolution is 1.0x, which one is 2.0x and so on?
The related part of Flutter Docs is here:
Declaring resolution-aware image assets - flutter.io

Related

How can I access All Files inside device of specific type (e.g image, audios, videos) etc in flutter

I want to make my own media picker, where I will open screen and show all images of device in case of image picker, show all audios on the device in case of audio picker and all videos for video picker. The method must work on both android and IOS. I am using flutter Dart to do this. I am new in flutter and any help will be highly appricated.
I have tried Flutter File manager and unable to do this.
There is a package available named File Picker have look into it. Its very well documented.

How to know which Asset size will be loaded by Flutter?

I want to dynamically load images from the web for my Flutter App, but I don't want to load big images for devices with a small screen, as those devices also tend to be slow and have slower internet connections.
For Assets pre-loaded into the App, I can save them in folders named 2.0x and etc. and Flutter will automatically load the correct asset for the device's screen resolution. Is it here a way for me to ask Flutter which asset size will be loaded (and get an answer like 2.0) for the current device, so I can then load the image with that size from my server?
The devicePixelRatio property can be used for your use case.
It returns the the number of device pixels for each logical pixel.
The value returned by devicePixelRatio is ultimately obtained either from the hardware itself, the device drivers, or a hard-coded value stored in the operating system or firmware.

Flutter Camera plugin (auto zoom)

first of all sorry my english
I'm developing a flutter application using the camera flutter plugin, after capturing the images I upload to amazon's S3
everything works fine, but users have begun to complain that the images taken on my app and the camera's native app look very different
in my app the image looks like I've been zoomed in by cropping the sides and top
in the native app the area that the camera captures is much larger
I would like my app to take photos like the native app (same area)
it is possible?
I already searched and found nothing related to it, I already changed the
ResolutionPreset.max
changed the size of my cameraPreview
unsuccessfully
Any help is welcome
thanks
I was able to resolve by updating the plugin version
I was using the camera: ^ 0.5.6
now I'm with
camera: ^ 0.5.7 + 3

Font size for different size and dpi devices in smartface

I am developing an mobile app which should support for all type of device sizes and dpi's.
Is there any short-way or formula that i can implement for font sizes basing on dpi value of the device?
Can any one suggest whats the best way to implement font sizes for all my controls in Smartface App Studio to support all type of devices!
You should check this link about images : http://www.smartface.io/developer/guides/project/anatomy-project/#images
There is no way to make it look good for all devices by using only one folder. Because different devices have different resolutions, icons should be added to the related folder.
For iOS, there is only one folder. You should use original icons, lets say it is myicon.png, also you should use 2 times the original icon(make it 2 times larger) and add it too into the same folder and name it as myicon#2x.png.
That is all for iOS.
But for Android, there are more different resolutions. You should find the correct folder for your device from the link. I can simply suggest you to keep in mind that, your original icon should be placed under mdpi folder, you should use 1.5 times original in hdpi folder and you should use 2 times the original icon for xhdpi folder.

Saving pictures for iphone and android from Photoshop

Saving pictures for use in iPhone and Android applications is a real bore.
Having to make 2 separate versions for iPhone is tedious enough and then creating 3/4 versions for android (or more) is just as difficult.
Is there no way to make one set of pictures in photoshop and have them save in the various formats and sizes for iphone and android?
For instance creating them at the highest resolution necessary and it does all the resizing and such automatically (as if you were to change the image size).
Or am I really going to have to refactor each and every image in my apps?!
Thanks
Tom
I think Adobe Device Central and actions/macros in Photoshop may help you to solve your task.