Open FrBernad opened 1 year ago
Hey @FrBernad :wave: Thanks for creating an issue and sorry for my absence lately.
Indeed, data
is a public property of BeamLocation
so it can be accessed freely.
Fun fact; so is the state
, but it was added as a parameter to buildPages
out of convenience, because it is literary always used. I was thinking of adding data
too...
data
should be set before buildPages
is called :thinking:
It is set in the update
(the function that all the beamTo*
functions call) and buildPages
is called during build
, which is triggered at the end of update
.
Do you have a small example that demonstrates how data
is not available during buildPages
?
What's the equivalent of the data parameter for a Location Builder using a Beam Location?
The RoutersLocationBuilder receives a data parameter, but It's not the case with the buildPages of a locationBuilder.
'/': (context, state, data) => HomeScreen(),
List<BeamPage> buildPages(BuildContext context, BeamState state)
Reading the source code I find out that the data object is added as property to the currentLocation, but that is after the build pages method is called, so there is not way of accessing that instance of the data object in the buildPages method.
Accessing the current data object inside the build pages method should be a thing right?