Skip to content

Commit

Permalink
updated BeamerDelegate
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenzohidalgo committed Oct 17, 2022
1 parent ec9006c commit 738b002
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions package/lib/src/beamer_delegate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,13 @@ class BeamerDelegate extends RouterDelegate<RouteInformation>
bool popBeamLocationOnPop = false,
bool stacked = true,
bool replaceRouteInformation = false,
Map<String, dynamic>? queryParameters,
}) {
update(
configuration: RouteInformation(location: uri, state: routeState),
configuration: RouteInformation(
location: constructUri(uri, queryParameters),
state: routeState,
),
beamParameters: _currentBeamParameters.copyWith(
popConfiguration:
popToNamed != null ? RouteInformation(location: popToNamed) : null,
Expand All @@ -573,10 +577,11 @@ class BeamerDelegate extends RouterDelegate<RouteInformation>
bool beamBackOnPop = false,
bool popBeamLocationOnPop = false,
bool stacked = true,
Map<String, dynamic>? queryParameters,
}) {
removeLastHistoryElement();
beamToNamed(
uri,
constructUri(uri, queryParameters),
routeState: routeState,
data: data,
popToNamed: popToNamed,
Expand Down Expand Up @@ -604,10 +609,12 @@ class BeamerDelegate extends RouterDelegate<RouteInformation>
bool popBeamLocationOnPop = false,
bool stacked = true,
bool replaceRouteInformation = false,
Map<String, dynamic>? queryParameters,
}) {
final fullUri = constructUri(uri, queryParameters);
while (beamingHistory.isNotEmpty) {
final index = beamingHistory.last.history.lastIndexWhere(
(element) => element.routeInformation.location == uri,
(element) => element.routeInformation.location == fullUri,
);
if (index == -1) {
_disposeBeamLocation(beamingHistory.last);
Expand All @@ -620,7 +627,7 @@ class BeamerDelegate extends RouterDelegate<RouteInformation>
}
}
beamToNamed(
uri,
fullUri,
routeState: routeState,
data: data,
popToNamed: popToNamed,
Expand Down

0 comments on commit 738b002

Please sign in to comment.