-
-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Static typing for AssetLoader #524
Comments
Thanks for submitting this and explaining a solution! Maybe you want to submit a PR which implements that? |
@bw-flagship done. The plan is:
Note that for both packages this is a breaking change, so the bump to 4.0.0 is required. You may want to hold back publishing until you do more breaking changes and cleanup that were coming. |
Why did you change the file names? It is not necessary for deduplicating the AssetLoader, isn't it? |
I did not change them but sorted alphabetically. There is a lint for this: https://dart-lang.github.io/linter/lints/directives_ordering.html I just did a quick scan of what I can easily fix. I can undo that if you want. |
I meant this breaking change: - **BREAKING**: `JsonAssetLoader`, `XmlAssetLoader`, and `YamlAssetLoader` now use `_` instead of `-` when converting a locale to a file name. Why is this change necessary? |
These loaders were using This function was defined in both The straightforward way to keep the old behavior was to use the deprecated function from When you asked, I discovered that Still the |
Thanks for explanation. I would prefer to preserve the old behavior to reduce breaking changes to a minimum :) |
Done. |
Currently
EasyLocalization.assetLoader
is dynamic.It defaults to
RootBundleAssetLoader
that extends a localAssetLoader
class.easy_localization_loader
has its own abstractAssetLoader
, and its loaders extend it.The following change will improve type safety:
EasyLocalization.assetLoader
to the localAssetLoader
class.AssetLoader
duplicate fromeasy_localization_loader
.easy_localization_loader
, depend oneasy_localization
and make all loaders extend itsAssetLoader
.The text was updated successfully, but these errors were encountered: