You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
I'm not sure if this is a bug or a feature. I have a complex app that I've built, and I need to migrate from Navigator 1.0 to Beamer,
I successfully used BeamerLocationBuilder with beamLocations, but I was hit by some of the code that I need to migrate and I don't know if Beamer can handle this situation:
I have a code that use a scanner, then get the result back as follows:
onPressed: () async {
var result =awaitNavigator.of(context).pushNamed(QrScanPage.route);
qrcodeResult ="";
if (result isString) {
qrcodeResult = result;
}
// Try to extract project id and daily check group id from qrcodetry {
ProjectIdAndDailyCheckGroupId result =Project.extractProjectIdAndDailyCheckGroupId(qrcodeResult);
SchedulerBinding.instance.addPostFrameCallback((_) {
Navigator.of(context)
.pushNamed(DailyCheckGroupEventsPage.route, arguments: [int.parse(result.projectId), int.parse(result.dailyCheckGroupId)]);
});
} catch (_e) {}
How can migrate such code ?:
var result =awaitNavigator.of(context).pushNamed(QrScanPage.route);
This functionality is a bit different in "Navigator 2.0" and is not currently well supported in Beamer. I plan to improve it for v2.
Still, you have 2 options:
Continue using "Navigator 1.0" for this specific scenario. Beamer has no problem with using both APIs, i.e. you can just continue using var result = await Navigator.of(context).pushNamed(QrScanPage.route). But this will not update URL so you would need to (if you need to) do it manually with Beamer.of(context).updateRouteInformation(...). As I said, this is the scenario I'm looking to improve in the near future.
From the QrScanScreen, save the result in some object you use for state management and then override onPopPage (which is called when you pop) in your BeamPage for QrScanScreen where you should be able to extract the wanted result from your state management.
Describe the bug
A clear and concise description of what the bug is.
I'm not sure if this is a bug or a feature. I have a complex app that I've built, and I need to migrate from Navigator 1.0 to Beamer,
I successfully used
BeamerLocationBuilder
withbeamLocations
, but I was hit by some of the code that I need to migrate and I don't know if Beamer can handle this situation:I have a code that use a scanner, then get the result back as follows:
How can migrate such code ?:
Beamer version: (e.g.
v0.14.1
,master
, ...)beamer: ^1.4.1+1
Thank you for making this package
The text was updated successfully, but these errors were encountered: