flame-engine / flame-engine/flame
New `frozen` option on route/screen layering
- Dominant language
- Dart
- Stars
- 10.8k
- Forks
- 1k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 21
Description
# Problem to solve
Hello guys, I have an issue when I want a A screen to be the frozen background of a B screen. I initially created a new `RouterComponent` with those 2 screens (that are `Component`s), and made the B screen _transparent_ allowing me to see through, thus the A screen.
```dart
router = RouterComponent(
routes: {
'world': Route(WorldScreen.new), //A screen
'collection': Route(CollectionScreen.new, transparent: true), //B screen
},
initialRoute: 'home',
),
```
But it doesn't work well. When I'm on the B screen, all events like tappables or draggables enabled on A screen are still triggered, as if the focus was on the 2 screens instead of the one we selected, thus the B screen.
We can also see that on the [Flame router demo](https://docs.flame-engine.org/1.6.0/flame/router.html#valueroute) just below, when the _Rate me_ button is still active and triggerable even if the dialog box is at foreground. That's a little bit problematic.

# Proposal
An interesting thing could be a new option `frozen` on a Route, that precises that this route can't have its events triggered if a foreground route has the focus.
What do you think of it ?
Contributor guide
Assessment
This issue has not been assessed yet.