Skip to content

Commit

Permalink
fix(routing): settings page routing
Browse files Browse the repository at this point in the history
Before this commit the Settings Page was not considered as a route,
instead all the content of the page was replacing the content below,
since the `_notTransitionPageRoute()` method was used to "push" the
route.

After this commit to push the route the `_cupertinoPageRoute()` method
is being used. With that edit the Settings Page is treated like a normal
route, and so it's possible to swipe back and navigate correctly to the
route.

Closes: RIP-Comm#218
  • Loading branch information
fres-sudo committed Feb 26, 2025
1 parent f3bfb88 commit deb9fc2
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions lib/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Route<dynamic> makeRoute(RouteSettings settings) {
case '/graphs':
return _materialPageRoute(settings.name, const GraphsPage());
case '/settings':
return _noTransitionPageRoute(settings.name, const SettingsPage());
return _cupertinoPageRoute(settings.name, const SettingsPage());
case '/general-settings':
return _cupertinoPageRoute(settings.name, const GeneralSettingsPage());
case '/notifications-settings':
Expand Down Expand Up @@ -90,14 +90,3 @@ PageRoute _materialPageRoute(String? routeName, Widget viewToShow) {
builder: (_) => viewToShow,
);
}

PageRoute _noTransitionPageRoute(String? routeName, Widget viewToShow) {
return PageRouteBuilder(
transitionDuration: const Duration(),
reverseTransitionDuration: const Duration(),
settings: RouteSettings(
name: routeName,
),
pageBuilder: (_, __, ___) => viewToShow,
);
}

0 comments on commit deb9fc2

Please sign in to comment.