shell_route_transitions 0.0.7
shell_route_transitions: ^0.0.7 copied to clipboard
A Flutter package that provides beautiful and customizable transitions for shell routes in Flutter applications.
Shell Route Transitions #
A Flutter package that provides beautiful and customizable transitions for shell routes in Flutter applications. This package makes it easy to add professional-looking animations when navigating between routes.
Features #
- Multiple Animation Types: Choose from several pre-built animations:
- Fade transitions
- Horizontal slide transitions
- Vertical slide transitions
- Scale transitions
- Customizable: Create your own custom transitions
- Easy Integration: Simple to use with Go Router or other navigation solutions
- Performant: Optimized for smooth animations
Transition Types #
Fade Transition #
Horizontal Slide Transition #
Vertical Slide Transition #
Scale Transition #
Getting Started #
Add the package to your pubspec.yaml
file:
dependencies:
shell_route_transitions: ^0.0.2
copied to clipboard
Then run:
flutter pub get
copied to clipboard
Usage #
Basic Usage #
final goRouter = GoRouter(
initialLocation: '/a',
debugLogDiagnostics: true,
routes: [
AnimatedStatefulShellRoute(
transitionDuration: const Duration(milliseconds: 300),
transitionBuilder: ShellRouteTransitions.scale,
builder: (context, state, navigationShell) {
return ScaffoldWithNestedNavigation(navigationShell: navigationShell);
},
branches: [
StatefulShellBranch(
routes: [
GoRoute(
path: '/a',
builder:
(context, state) =>
const RootScreen(label: 'A', detailsPath: '/a/details'),
),
],
),
.....
```
### Available Transitions
```dart
// Fade transition
ShellRouteTransitions.fade
// Horizontal slide transition
ShellRouteTransitions.slideHorizontal
// Vertical slide transition
ShellRouteTransitions.slideVertical
// Scale transition
ShellRouteTransitions.scale
copied to clipboard