💫 Optimize region animations

This commit is contained in:
LittleSheep 2024-09-16 20:06:15 +08:00
parent 5941cb9fd5
commit 675b5dea5d

View File

@ -1,3 +1,4 @@
import 'package:animations/animations.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:solian/models/realm.dart'; import 'package:solian/models/realm.dart';
@ -126,16 +127,12 @@ class _AppNavigationRegionState extends State<AppNavigationRegion> {
final NavigationStateProvider navState = Get.find(); final NavigationStateProvider navState = Get.find();
return Obx( return Obx(
() => AnimatedSwitcher( () => PageTransitionSwitcher(
switchInCurve: Curves.fastOutSlowIn, transitionBuilder: (child, animation, secondaryAnimation) {
switchOutCurve: Curves.fastOutSlowIn, return SharedAxisTransition(
duration: const Duration(milliseconds: 300), animation: animation,
transitionBuilder: (child, animation) { secondaryAnimation: secondaryAnimation,
return SlideTransition( transitionType: SharedAxisTransitionType.horizontal,
position: Tween<Offset>(
begin: const Offset(1.0, 0.0),
end: Offset.zero,
).animate(animation),
child: Material( child: Material(
color: Theme.of(context).colorScheme.surface, color: Theme.of(context).colorScheme.surface,
child: child, child: child,