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
Localization support #49
Comments
Have you tried using a |
I've tried running your exact test but with Image.asset() and Image.file() widgets along with a text - the image is not rendered if I pass your However, after I removed the Try running your asset_image_smoke_test but with
It won't render the red square 🟥 : But if you run the same test as above but without
These tests were run on alchemist v0.3.3 |
Oh I see, sorry I misinterpreted your issue. Looks like this is being caused by the
Future<FakeLocalizations> load(Locale locale) => SynchronousFuture(FakeLocalizations());
pumpBeforeTest: (tester) async {
await pumpOnce(tester);
await precacheImages(tester);
} Let me know if this solves your issue! |
Thanks for your help @Kirpal! It actually solved my issue! This extra pump actually resolved the issue for me, and I was testing with real localisation, not the fake one :) I am not 100% sure that this workaround will resolve all of the similar cases, but maybe |
I'm conflicted about adding it to precache images because it might be unexpected in some cases (while necessary in cases like this). I lean more on the side of not including it because that allows for more precise control of the rendering. If it were to be included in I do think it's probably worth documenting this somewhere though because this case will happen in other widgets with similar rendering behavior to Localizations(deferring the first frame). |
Yes, I agree with you. But it is worth documenting this case for sure then. Thanks a lot for your help Kirpal! |
Is there an existing feature request for this?
Command
It would be awesome to add a support for the localisation in the library
Description
First of all, thanks for an awesome library and your work!
The problem is, I haven't found a proper way to add localisations delegate to the golden test, and this feature is extremely important to have in order to test any widget with localisation.
I've added localizationsDelegates param in my fork to enable localisation, and it actually worked. But the problem is, after adding an
AppLocalizationDelegate
to theMaterialApp
, alchemist has stopped rendering any kind of images. Any asset or file image would become transparent. However, after removing the delegate, images appear again. I've tested adding the sameAppLocalizationDelegate
to the MaterialApp with a golden_toolkit library, and there was no such problem (images were rendered and localisation worked as well).Maybe you have any ideas on how to add a localizationsDelegates to the test in a way that prevents this issue with rendering images?
Reasoning
I think that supporting localisation in the library would greatly increase the usability
Additional context and comments
You can refer to my closed PR, where I've added the coreWrapper: #43
The text was updated successfully, but these errors were encountered: