ferrodown.blogg.se

Root folder icon png
Root folder icon png





root folder icon png

3.0x/my_icon.png should be 216px by 216px īut they both render into 72px by 72px (in logical pixels),Įach entry in the asset section of the pubspec.yaml The asset so that it occupies the same amount of screen spaceĪs the main asset would have, just with a higher resolution. On the Image widget, the nominal resolution is used to scale If the width and height of the rendered image are not specified On devices with a device pixel ratio of 1.8, the assetįor a device pixel ratio of 2.7, the asset You can use rootBundle to directly load such assets. Outside of a Widget context, or when a handle To indirectly load an asset, for example a JSON file, Typically, you’ll use DefaultAssetBundle.of() Which can be useful for localization or testing However, it’s recommended to obtain the AssetBundleĭefaultAssetBundle, rather than the defaultĪsset bundle that was built with the app thisĪpproach enables a parent widget to substitute a It is possible to load assets directly using the Object for easy access to the main asset bundle. To the asset specified in the pubspec.yaml file at build time. String/text asset ( loadString()) or an image/binary asset ( load()) The two main methods on an asset bundle allow you to load a Your app can access its assets through an

root folder icon png

Include variants for different locales or regions, In the future, this mechanism might be extended to Then the graphics/my_icon.png, graphics/background.pngĪnd graphics/dark/background.png files are also included.įlutter uses asset variants when choosing resolution-appropriate Included in the asset bundle along with the specified asset.įor example, if you have the following files in The build process looks for any files with the same The build process supports the notion of asset variants:ĭifferent versions of an asset that might be displayed ( assets in first example or directory in the aboveĭuring a build, Flutter places assets into a specialĪrchive called the asset bundle that apps read The order in which the assets areĭeclared doesn’t matter. (relative to the pubspec.yaml file) where the assetįile is located. Specifies files that should be included with the app.Įach asset is identified by an explicit path The assets subsection of the flutter section To add files located in subdirectories, create There are files with the same name inside a subdirectory Only files located directly in the directory are included unless Flutter : assets : - directory/ - directory/subdirectory/







Root folder icon png