Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Adds new route methods pushReplacement, pushReplacementNamed, and pushReplacementOverlay #2249

Merged
merged 17 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/flame/lib/src/components/route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ class Route extends PositionComponent with ParentIsA<RouterComponent> {
final bool maintainState;

/// The name of the route (set by the [RouterComponent]).
String get name => _name;
late String _name;
String? get name => _name;
late String? _name;
munsterlander marked this conversation as resolved.
Show resolved Hide resolved
@internal
set name(String value) => _name = value;
set name(String? value) => _name = value;

/// The function that will be invoked in order to build the page component
/// when this route first becomes active. This function may also be `null`,
Expand Down
5 changes: 0 additions & 5 deletions packages/flame/lib/src/components/router_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,6 @@ class RouterComponent extends Component {

/// Local method to bypass [pop]'s assert
void _popWithoutMinimumAssert() {
assert(
_routeStack.isNotEmpty,
'There must be a route to pop.',
);

final route = _routeStack.removeLast();
route.didPop(_routeStack.last);
route.removeFromParent();
Expand Down