Closed devibrahimkarahan closed 5 years ago
Hi @devibrahimkarahan 👋 Thanks for opening an issue!
Are you able to share a link to a sample app with which I can reproduce the issue? Thanks! 👍
Sorry, I'm creating sample app now.
No worries! Thanks 😄
Lol, when i create sample app, i found the solution :). I m using my own localization class, and it have a load function for get strings map from file, and it takes a little bit time, when i remove that line problem resolved. But i dont understand why it works when downgrade to 0.17.0 :)
You can close, sorry. Best regards.
Maybe someone will encounter the same situation I share the solution.
My old load function
Future<void> _load() async {
String jsonString = await rootBundle.loadString(
"assets/lang/${_locale.languageCode}.json",
);
_strings = Map.from(json.decode(jsonString));
}
New version
Future<void> _load() async {
await null;
rootBundle
.loadString("assets/lang/${_locale.languageCode}.json")
.then((jsonString) {
_strings = Map.from(json.decode(jsonString));
});
}
@devibrahimkarahan hello. I have the same issue here, please can you check it?
I'm checking session on splash screen, if user logged before, I'm redirect user to main screen, otherwise redirect to login page. But after rerun app, bloc yield state before splash build.
Problem occurs in version >= 0.18.0, No problem with versions 0.17.0 and below
When i open the app after first opening (install > first open (no problem) > close and rerun (problem occurs now)) AppStarted event triggered before splash build, because of this i cant redirect user login page or main page.
main.dart
My authentication bloc
Splash page ( root )
Logs when first opening after install As you can see, after checking session, bloc triggered
AuthenticationUnauthenticated
afterbuild splash
, this is what i want.And now when i restart app As you can see,
AuthenticationUnauthenticated
state triggered before build splash.flutter doctor -v