Skip to content

refresh auto#68

Open
john-yang-11 wants to merge 1 commit intomainfrom
refresh-branch
Open

refresh auto#68
john-yang-11 wants to merge 1 commit intomainfrom
refresh-branch

Conversation

@john-yang-11
Copy link

@john-yang-11 john-yang-11 commented Mar 21, 2026

This does the refresh automatically for the times when clicking a bus stop:
Added the timer with the function to initialize the state and an override so if you leave the page, it would stop the timer. I also made changes to the build.gradle.kts in the \app file because when I was trying to make my emulator run, it was having issues due to Kotlin not being updated, so I asked Geminai, and that's the file change.

Copy link
Member

@i-kumar i-kumar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You did more than just adjust the auto refreshing. Edit your PR description to include what else changed (like the fact that you had to adjust the android files)

@john-yang-11 john-yang-11 requested a review from i-kumar March 22, 2026 00:18
versionCode = flutter.versionCode
versionName = flutter.versionName
resValue("string", "google_maps_api_key", localProperties.getProperty("GOOGLE_MAPS_API_KEY"))
resValue("string", "google_maps_api_key", localProperties.getProperty("GOOGLE_MAPS_API_KEY") ?: "")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you change it so that if there's no key, it results in ""? We want the code to only compile if there's a key

@jumpy-cat
Copy link
Member

There is some weird behavior with minimizing the app (tested with android simulator). The timer still ticks once or twice but due to the app being in the background the network request fails. When the app is opened again it shows the failed to load state. If the app is minimized for a while it will immediately refresh upon reopening, but then the timer might fire again before 30s has passed (it happened after 5-ish seconds once for me).

I'd recommend starting and stopping the timer based on the state of the app (look at AppLifecycleListener). Probably preserve the refresh upon reopening behavior.

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

Successfully merging this pull request may close these issues.

Auto-Refresh Stop

5 participants