import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; import 'router_key.dart'; import 'package:together_mobile/screens/contact/contact_apply_screen/contact_apply_screen.dart'; import 'package:together_mobile/screens/contact/contact_screen.dart'; import 'package:together_mobile/screens/contact/friend_group_screen/friend_group_screen.dart'; import 'package:together_mobile/screens/contact_add/contact_add_friend_screen/contact_add_friend_screen.dart'; import 'package:together_mobile/screens/contact_add/search_new_screen.dart'; import 'package:together_mobile/screens/friend_profile/friend_profile_screen.dart'; import 'package:together_mobile/screens/group_chat_profile/group_chat_profile_screen.dart'; final contactRouter = GoRoute( path: '/contact', name: 'Contact', builder: (context, state) => const ContactScreen(), routes: [ GoRoute( parentNavigatorKey: rootNavigatorKey, path: 'add', name: 'AddContact', builder: (context, state) => const SearchNewScreen(), routes: [ GoRoute( path: 'friend', name: 'AddFriend', parentNavigatorKey: rootNavigatorKey, builder: (context, state) => const ContactAddFriendScreen(), ), ], ), GoRoute( parentNavigatorKey: rootNavigatorKey, path: 'apply_list', name: 'ApplyList', builder: (context, state) => const ContactApplyList(), ), GoRoute( parentNavigatorKey: rootNavigatorKey, path: 'friend_group', name: 'FriendGroup', pageBuilder: (context, state) { return CustomTransitionPage( key: state.pageKey, child: const FriendGroupScreen(), transitionDuration: const Duration( milliseconds: 200, ), reverseTransitionDuration: const Duration(milliseconds: 200), transitionsBuilder: ( context, animation, secondaryAnimation, child, ) { const begin = Offset(1.0, 0.0); const end = Offset.zero; final tween = Tween(begin: begin, end: end); final offsetAnimation = animation.drive(tween); return SlideTransition( position: offsetAnimation, child: child, ); }, ); }, builder: (context, state) => const FriendGroupScreen(), ), GoRoute( parentNavigatorKey: rootNavigatorKey, path: 'friend_profile', name: 'FriendProfile', builder: (context, state) => const FriendProfileScreen(), ), GoRoute( parentNavigatorKey: rootNavigatorKey, path: 'group_chat_profile', name: 'GroupChatProfile', builder: (context, state) => const GroupChatProfileScreen(), ), ], );