slide transition of menu

This commit is contained in:
Patrick Alvin Alcala 2025-04-04 10:06:19 +08:00
parent 9de2d0e7d2
commit b892cc485f
8 changed files with 113 additions and 15 deletions

View file

@ -84,45 +84,143 @@ final _router = GoRouter(
path: '/main',
builder: (context, state) => const MainPage(),
),
// GoRoute(
// name: 'addmanufactorer',
// path: '/addmanufactorer',
// builder: (context, state) => const AddManufacturerPage(),
// ),
GoRoute(
name: 'addmanufactorer',
path: '/addmanufactorer',
builder: (context, state) => const AddManufacturerPage(),
pageBuilder: (BuildContext context, GoRouterState state) => CustomTransitionPage<void>(
key: state.pageKey,
child: const AddManufacturerPage(),
transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation,
Widget child) =>
SlideTransition(
position: animation.drive(
Tween<Offset>(begin: Offset(0.95, 0), end: Offset.zero).chain(CurveTween(curve: Curves.easeIn))),
child: child),
),
),
// GoRoute(
// name: 'addmedicines',
// path: '/addmedicines',
// builder: (context, state) => const AddMedicinePage(),
// ),
GoRoute(
name: 'addmedicines',
path: '/addmedicines',
builder: (context, state) => const AddMedicinePage(),
pageBuilder: (BuildContext context, GoRouterState state) => CustomTransitionPage<void>(
key: state.pageKey,
child: const AddMedicinePage(),
transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation,
Widget child) =>
SlideTransition(
position: animation.drive(
Tween<Offset>(begin: Offset(0.95, 0), end: Offset.zero).chain(CurveTween(curve: Curves.easeIn))),
child: child),
),
),
// GoRoute(
// name: 'addgenerics',
// path: '/addgenerics',
// builder: (context, state) => const AddGenericsPage(),
// ),
GoRoute(
name: 'addgenerics',
path: '/addgenerics',
builder: (context, state) => const AddGenericsPage(),
pageBuilder: (BuildContext context, GoRouterState state) => CustomTransitionPage<void>(
key: state.pageKey,
child: const AddGenericsPage(),
transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation,
Widget child) =>
SlideTransition(
position: animation.drive(
Tween<Offset>(begin: Offset(0.95, 0), end: Offset.zero).chain(CurveTween(curve: Curves.easeIn))),
child: child),
),
),
// GoRoute(
// name: 'addtype',
// path: '/addtype',
// builder: (context, state) => const AddTypePage(),
// ),
GoRoute(
name: 'addtype',
path: '/addtype',
builder: (context, state) => const AddTypePage(),
pageBuilder: (BuildContext context, GoRouterState state) => CustomTransitionPage<void>(
key: state.pageKey,
child: const AddTypePage(),
transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation,
Widget child) =>
SlideTransition(
position: animation.drive(
Tween<Offset>(begin: Offset(0.95, 0), end: Offset.zero).chain(CurveTween(curve: Curves.easeIn))),
child: child),
),
),
// GoRoute(
// name: 'addcategory',
// path: '/addcategory',
// builder: (context, state) => const AddCategoryPage(),
// ),
GoRoute(
name: 'addcategory',
path: '/addcategory',
builder: (context, state) => const AddCategoryPage(),
pageBuilder: (BuildContext context, GoRouterState state) => CustomTransitionPage<void>(
key: state.pageKey,
child: const AddCategoryPage(),
transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation,
Widget child) =>
SlideTransition(
position: animation.drive(
Tween<Offset>(begin: Offset(0.95, 0), end: Offset.zero).chain(CurveTween(curve: Curves.easeIn))),
child: child),
),
),
GoRoute(
name: 'addstock',
path: '/addstock',
builder: (context, state) => const AddStockPage(),
),
GoRoute(
// GoRoute(
// name: 'liststocks',
// path: '/liststocks',
// builder: (context, state) => const ListStocksPage(),
// ),
GoRoute(
name: 'liststocks',
path: '/liststocks',
builder: (context, state) => const ListStocksPage(),
pageBuilder: (BuildContext context, GoRouterState state) => CustomTransitionPage<void>(
key: state.pageKey,
child: const ListStocksPage(),
transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation,
Widget child) =>
SlideTransition(
position: animation.drive(
Tween<Offset>(begin: Offset(0.95, 0), end: Offset.zero).chain(CurveTween(curve: Curves.easeIn))),
child: child),
),
),
// GoRoute(
// name: 'deletestock',
// path: '/deletestock',
// builder: (context, state) => const DeleteStockPage(),
// ),
GoRoute(
name: 'deletestock',
path: '/deletestock',
builder: (context, state) => const DeleteStockPage(),
pageBuilder: (BuildContext context, GoRouterState state) => CustomTransitionPage<void>(
key: state.pageKey,
child: const DeleteStockPage(),
transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation,
Widget child) =>
SlideTransition(
position: animation.drive(
Tween<Offset>(begin: Offset(0.95, 0), end: Offset.zero).chain(CurveTween(curve: Curves.easeIn))),
child: child),
),
),
GoRoute(
name: 'customer',