-->
as our flutter packages grow up, we need to split them into different packages, but some thing we need to handle, today we will talk about these things.
you can keep your assets in different packages, just notice when to use these assets, you cannot just do like in the main app:
image: DecorationImage(
image:
AssetImage("assets/background/main.jpg"),// this will be an error(if you dont copy the image to your main assets folder)
fit: BoxFit.cover,
),
you should add the package name to the assets path like this:
image: DecorationImage(
image:
AssetImage("packages/yes_or_no/assets/background/main.jpg"),
fit: BoxFit.cover,
),
To use localization in Flutter sub package is almost the same as use it in main package, just we need to take care of the location of generated class.
The main steps is here Flutter - how to set localization in sub packages