refactor: conditionalize profile fields, update chat navigation transitions, and fix provider state management during widget lifecycle
This commit is contained in:
@@ -160,7 +160,9 @@ final routerProvider = Provider<GoRouter>((ref) {
|
||||
return CustomTransitionPage(
|
||||
key: state.pageKey,
|
||||
child: ChatScreen(conversationId: id),
|
||||
transitionsBuilder: _fadeTransition,
|
||||
transitionDuration: const Duration(milliseconds: 250),
|
||||
reverseTransitionDuration: const Duration(milliseconds: 200),
|
||||
transitionsBuilder: _slideTransition,
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -272,6 +274,22 @@ class _HomeRouteWrapper extends ConsumerWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// Slide from right transition for push-style navigation.
|
||||
Widget _slideTransition(
|
||||
BuildContext context,
|
||||
Animation<double> animation,
|
||||
Animation<double> secondaryAnimation,
|
||||
Widget child,
|
||||
) {
|
||||
return SlideTransition(
|
||||
position: Tween<Offset>(
|
||||
begin: const Offset(1, 0),
|
||||
end: Offset.zero,
|
||||
).animate(CurvedAnimation(parent: animation, curve: Curves.easeOut)),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
||||
/// Smooth fade transition for tab-to-tab navigation.
|
||||
Widget _fadeTransition(
|
||||
BuildContext context,
|
||||
|
||||
Reference in New Issue
Block a user