I hit a weird (but common) UI issue in my Flutter music player app:
Whenever I tapped the mini player to open the full screen player, the seek bar would flash 0:00 for a split second — and then jump to the actual current timestamp.
It looked like playback was restarting every time. Spoiler: it wasn’t.
What was happening?
The full screen player uses a StreamBuilder to listen to the current position (Stream). But when the widget builds, that stream hasn’t emitted anything yet — so it shows 0:00 by default.
Only after the stream sends the actual position does the UI update. That tiny delay causes the annoying visual "jump".
initialData: musicService.currentPosition,
Adding this to the StreamBuilder gives it a starting value immediately — the latest position we already have from our service.
So now the UI starts at the right place without waiting for the stream to emit.
No more flicker. No more weird jumps. Just smooth playback
Hope this helps someone else!