Skip to content
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

Flutter Drive not working with flutter_translate #53

Closed
AlexBacich opened this issue Sep 15, 2020 · 7 comments
Closed

Flutter Drive not working with flutter_translate #53

AlexBacich opened this issue Sep 15, 2020 · 7 comments

Comments

@AlexBacich
Copy link
Contributor

Problem: when you test your app with Flutter Drive - app will stay on White screen while trying to init the app.

To be more specific, this call is never executes:
final delegate = await LocalizationDelegate.create(fallbackLocale: 'en_US', supportedLocales: ['en_US']);

Root cause of the issue is inside locale_file_service.dart - Future getLocaleContent(String file) method.

This code hangs:

return rootBundle.loadString(file);

This code will work:

static Future<String> getLocaleContent(String file) async
    {
        final ByteData data = await rootBundle.load(file);
        if (data == null) return null;
        return utf8.decode(data.buffer.asUint8List());
    }

Underlying reason for that (if qurious to read) is here:
flutter/flutter#24703

@bratan
Copy link
Member

bratan commented Sep 15, 2020

Hi, thanks for reporting this issue but as far as I can see this is an issue with flutter_driver and not flutter_translate?

@AlexBacich
Copy link
Contributor Author

Yes, this I flutter_driver issue, however it hasn't been resolved for years. So to use flutter_translate together with flutter_driver it's possible to add workaround to flutter_translate.

@AlexBacich
Copy link
Contributor Author

@bratan , will you make this change sooner or later? I would prefer using your library from your repository rather than from fork. Or I can prepare PR if you want.

@Yayo-Arellano
Copy link

We have the same issue when running widgets tests, this code will timeout -> final delegate = await LocalizationDelegate.create(fallbackLocale: 'en_US', supportedLocales: ['en_US']);

@sourcerebels
Copy link

Having same issue when running widget tests. Please, can you provide an example? Thank you

@AlexBacich
Copy link
Contributor Author

@bratan , will you make the change?

@AlexBacich
Copy link
Contributor Author

I have created PR with fix: #57

@bratan bratan closed this as completed Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants