Can I have a persistent widget (or page) that doesn't reload as I navigate around?

Widgets & Design

I'm trying to build a super basic music player app, but I can't figure out how to achieve it in FlutterFlow, given that everything seems to be built on the idea of distinct pages; You always leave one page to go to a new page, and no components "float" independently with a long-living state.

The goal here is a simple music player which plays as you browse around the app while listening to music. (I've built that player already, as a custom component with just_audio). But currently, once I leave the player screen, there's no way to get back to it without it completely resetting.

I'm familiar with persistent app state variables, but I can't stick an instance of AudioPlayer in there.

I can get music to play in the background, even if I leave the player screen, and even if I close the app, but when I return, the player's state is completely reset, with absolutely no awareness of what happened previously or that there's a zombie playlist still playing. And even if I were to store a ton of "playerState" variables in the app state, I can't make a pause/play button in the new state talk to that zombified player from the old state.

I'm a fairly advanced software developer, but my client wanted to use FlutterFlow for various economic reasons. But I'm stumped here. My best idea to solve this would be to wrap all of the "normal" FlutterFlow stuff inside a master component which has the player. The user would navigate around within that master component, and starting the player from within the app would just be a matter of updating an app state variable that the master component would be listening to. That feels like the least destructive solution. And it seems to be something like how the bottom nav bar works.

Is there any way to do that in FlutterFlow?
...Or to have a "floating" component that doesn't refresh?
...Or force a page to never refresh?

Or is this not something FlutterFlow is built to do?

It doesn't necessarily need to be an overlaid widget or drawer or anything (though that would be cool). It can be as simple as a "now playing" page that I can go to at any time, which simply doesn't forget what it was doing every time I go to it.

What have you tried so far?

Searched high and low for any solution for persisting widgets in Flutter that isn't impossible in FlutterFlow.

Did you check FlutterFlow's Documentation for this topic?
Yes
1
6 replies