CATEGORIES
>>
Dart(2)
>>
Errors(5)
>>
Android(11)
>>
Errors(1)
>>
Errors(2)
>>
Windows 8(3)
>>
iPhone7(1)
>>
Errors(4)
>>
Html(1)
RECOMMENDED SITES
flutter Image.asset external package another library module
If you work flutter on multiple library/module/package;
How to show images in another package in main application? I will explain this.
Example Package Names
Main Application Package: my.app.imagetest
Business Flutter Library Name : my_business
MainApplication
pubspec.yaml
dependencies:
my_business:
path: ..\..\my_business
my_business
assets/images/warning.png (file exists current library)
my_business
pubspec.yaml
assets:
- assets/images/
my_business
testPage.dart
Image.assets("assets/images/warning.png")
In this way, the image is not displayed in the main application.
The following code is used to show it in the Main Application.
my_business
testPage.dart
AssetImage("assets/images/warning.png", package: "my_business")
TAGS
flutter Image.asset external package
TAGS
flutter Image.asset external package
flutter Image.asset multiple library
flutter Image.asset current module
flutter Image.asset dependency library
flutter Image.asset include library images
flutter Image.asset library not loaded
Author: Engin ATALAY
Date: 16.01.2021 20:12:17
View Count: 658
COMMENTS
krzysiek
27
Ocak
2023
11:03
Thanks a lot!