App reads the firebase value slowly

Friends, i have created an app which is controlled by using firebase value

In the screen1, i used two buttons(enter now and exit). If the value true mean enter now will display and exit will hide and wise versa.

But when the app initiates, in screen 1 both buttons are visible untill app reads and gets firebase data for couple of seconds .

How can i by pass it.?

When ever app open it should show as per the firebase realtime database value…

To avoid this i have created another main screen(as shown below ) in that screen also assigned firebase to read value but i am unable to solve it
Please suggest me

Use splash screen in place of button layout.

Thank yoi @golumaths100, i have never used such screens… Let me try herethen. Thank you for your reply

1 Like

to avoid that delay … use local TinyDB beside Firebase to store the last value

in screen initialization , read value from Tinydb and show buttons depend on it

when FirebaseDataChange : update the value in Tinydb also … so next time your app run you don’t need to wait Firebase

2 Likes