Skip to content

Commit

Permalink
fix(navigation): reverse detail transition builders to default ones
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-the-shark committed Aug 3, 2024
1 parent 7061723 commit a2ec323
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
3 changes: 0 additions & 3 deletions lib/config/transitions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import "package:auto_route/auto_route.dart";
// TODO(simon-the-shark): adjust this settings if desired
abstract class TransitionsConfig {
static const durationInMiliseconds = 200;
static const detailDurationInMiliseconds = 200;
static const slideLeftBuilder = TransitionsBuilders.slideLeftWithFade;
static const slideRightBuilder = TransitionsBuilders.slideRightWithFade;
static const fallbackBuilder = TransitionsBuilders.fadeIn;
static const detailViewBuilder = TransitionsBuilders.slideBottom;
}
22 changes: 3 additions & 19 deletions lib/features/navigator/app_router.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import "package:auto_route/auto_route.dart";
import "package:flutter/foundation.dart";
import "package:flutter/material.dart";
import "package:flutter_riverpod/flutter_riverpod.dart";
import "package:riverpod_annotation/riverpod_annotation.dart";
Expand Down Expand Up @@ -67,14 +66,9 @@ class AppRouter extends _$AppRouter {
transitionsBuilder:
ref.tabBarTransitionBuilder(DepartmentsRoute.name),
),
CustomRoute(
AutoRoute(
path: "departments/:id",
page: DepartmentDetailRoute.page,
durationInMilliseconds:
TransitionsConfig.detailDurationInMiliseconds,
reverseDurationInMilliseconds:
TransitionsConfig.detailDurationInMiliseconds,
transitionsBuilder: TransitionsConfig.detailViewBuilder,
),
CustomRoute(
path: "sci-clubs",
Expand All @@ -85,14 +79,9 @@ class AppRouter extends _$AppRouter {
transitionsBuilder:
ref.tabBarTransitionBuilder(ScienceClubsRoute.name),
),
CustomRoute(
AutoRoute(
path: "sci-clubs/:id",
page: ScienceClubDetailRoute.page,
durationInMilliseconds:
TransitionsConfig.detailDurationInMiliseconds,
reverseDurationInMilliseconds:
TransitionsConfig.detailDurationInMiliseconds,
transitionsBuilder: TransitionsConfig.detailViewBuilder,
),
CustomRoute(
path: "guide",
Expand All @@ -102,14 +91,9 @@ class AppRouter extends _$AppRouter {
TransitionsConfig.durationInMiliseconds,
transitionsBuilder: ref.tabBarTransitionBuilder(GuideRoute.name),
),
CustomRoute(
AutoRoute(
path: "aboutUs",
page: AboutUsRoute.page,
durationInMilliseconds:
TransitionsConfig.detailDurationInMiliseconds,
reverseDurationInMilliseconds:
TransitionsConfig.detailDurationInMiliseconds,
transitionsBuilder: TransitionsConfig.detailViewBuilder,
),
],
),
Expand Down

0 comments on commit a2ec323

Please sign in to comment.