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

Black screen between splash screen and first screen #380

Open
JErazo7 opened this issue Apr 29, 2021 · 8 comments
Open

Black screen between splash screen and first screen #380

JErazo7 opened this issue Apr 29, 2021 · 8 comments

Comments

@JErazo7
Copy link

JErazo7 commented Apr 29, 2021

The problem occurs when my JSON file becomes too large, as I delete at least 5 random keys and it works perfectly again.

@Yayo-Arellano
Copy link

I was having this issue too, the only way I could solve was to use code generation and instead of loading the json file from assets I used the generated class.

@MuhammadSufyanMalik
Copy link

did you guys face this issue for ios side, ?
#381

@wh120
Copy link

wh120 commented May 5, 2021

A problem is when set backgroundColor: Colors.transparent,

@Overman775
Copy link
Collaborator

its because preloader widget was been removed from 3.0.0 https://github.com/aissat/easy_localization/blob/develop/CHANGELOG.md#300

Add your own colored background widget or use your own solution

ColoredBox(
    color: Colors.red,
    child: EasyLocalization(

@Overman775
Copy link
Collaborator

The blinking appears because the localization is loaded asynchronously and when it is not there, the app bg is shown(black)

@omidraha
Copy link

omidraha commented Sep 5, 2021

I have same issue fixed as below, Here is my code,
Also I think the context.setLocale doesn't have normal behavior inside of FutureBuilder.

return FutureBuilder<bool>(
  future: changeLocale(
	context: context,
	languageCode: languageCode,
  ),
  builder: (context, snapshot) {
	if (snapshot.data == null) {
	  return SafeArea(
		child: Scaffold(
		  body: progressLoading(),
		),
	  );
	}
	return SplashScreen();
  },
);

.

Future<bool> changeLocale({
  required BuildContext context,
  required String languageCode,
}) async {
  Future<bool> _setLocale() async {
    await context.setLocale(
      getLocaleByCountry(languageCode)!,
    );
    return true;
  }

  return await _setLocale();
}

@RoPB
Copy link

RoPB commented Nov 12, 2021

Nice package but I can not use it because of this.

The problem as @Overman775 says its related to asyncronously locale load.
Here is a good explanation about what is going on using flutter_intl
https://github.com/Racinggavin/black_screen_inv (different but the same problem under the hood)

The solution I found was following exactly what it is described at the official flutter doc:
https://flutter.dev/docs/development/accessibility-and-localization/internationalization
However I loose lot of capabilities such as plurals etc.

@aBuder
Copy link

aBuder commented Oct 6, 2022

The blinking appears because the localization is loaded asynchronously and when it is not there, the app bg is shown(black)

Is there any solution to show preloader widget? In previous version, this was available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants