2024-01-27 17:19:03 -03:00
|
|
|
import 'package:recomendagro/src/app/auth/screens/cadastro.dart';
|
|
|
|
import 'package:recomendagro/src/app/auth/screens/codigoverifica.dart';
|
2024-01-27 13:25:17 -03:00
|
|
|
import 'package:recomendagro/src/app/auth/screens/login.dart';
|
2024-01-27 13:01:07 -03:00
|
|
|
import 'package:recomendagro/src/app/base/screens/splash.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
import 'package:go_router/go_router.dart';
|
|
|
|
|
|
|
|
final GlobalKey<NavigatorState> _rootNavigatorKey = GlobalKey<NavigatorState>(debugLabel: 'root');
|
|
|
|
final GlobalKey<NavigatorState> _shellNavigatorKey = GlobalKey<NavigatorState>(debugLabel: 'shell');
|
|
|
|
|
|
|
|
final routerProvider = Provider<GoRouter>((ref) {
|
|
|
|
return GoRouter(
|
|
|
|
initialLocation: SlapshScreen.path,
|
|
|
|
navigatorKey: _rootNavigatorKey,
|
|
|
|
debugLogDiagnostics: false,
|
|
|
|
routes: [
|
|
|
|
GoRoute(
|
|
|
|
path: SlapshScreen.path,
|
|
|
|
parentNavigatorKey: _rootNavigatorKey,
|
|
|
|
builder: (_, state) => const SlapshScreen()
|
|
|
|
),
|
2024-01-27 13:25:17 -03:00
|
|
|
GoRoute(
|
|
|
|
path: LoginScreen.path,
|
|
|
|
parentNavigatorKey: _rootNavigatorKey,
|
|
|
|
builder: (_, state) => const LoginScreen()
|
|
|
|
),
|
2024-01-27 17:19:03 -03:00
|
|
|
GoRoute(
|
|
|
|
path: CadastroScreen.path,
|
|
|
|
parentNavigatorKey: _rootNavigatorKey,
|
|
|
|
builder: (_, state) => const CadastroScreen()
|
|
|
|
),
|
|
|
|
GoRoute(
|
|
|
|
path: CodigoVerificacaoScreen.path,
|
|
|
|
parentNavigatorKey: _rootNavigatorKey,
|
|
|
|
builder: (_, state) => const CodigoVerificacaoScreen()
|
|
|
|
),
|
2024-01-27 13:01:07 -03:00
|
|
|
// GoRoute(
|
|
|
|
// path: RecuperarContaScreen.path,
|
|
|
|
// parentNavigatorKey: _rootNavigatorKey,
|
|
|
|
// builder: (_, state) => const RecuperarContaScreen()
|
|
|
|
// ),
|
|
|
|
// GoRoute(
|
|
|
|
// path: ComponentScreen.path,
|
|
|
|
// parentNavigatorKey: _rootNavigatorKey,
|
|
|
|
// builder: (_, state) => const ComponentScreen()
|
|
|
|
// ),
|
|
|
|
// GoRoute(
|
|
|
|
// parentNavigatorKey: _rootNavigatorKey,
|
|
|
|
// path: '${HomeSignScreen.pathDoc}/:id',
|
|
|
|
// pageBuilder: (_, state) => transitionScreen(
|
|
|
|
// state.pageKey,
|
|
|
|
// child: HomeSignScreen(urlState: state)
|
|
|
|
// )
|
|
|
|
// ),
|
|
|
|
// ShellRoute(
|
|
|
|
// navigatorKey: _shellNavigatorKey,
|
|
|
|
// builder: (context, state, child) {
|
|
|
|
// return BaseHomeDash(
|
|
|
|
// child: child
|
|
|
|
// );
|
|
|
|
// },
|
|
|
|
// routes: <RouteBase>[
|
|
|
|
// GoRoute(
|
|
|
|
// path: ListDocumentosScreen.path,
|
|
|
|
// pageBuilder: (_, state) => transitionScreen(
|
|
|
|
// state.pageKey,
|
|
|
|
// child: const ListDocumentosScreen()
|
|
|
|
// )
|
|
|
|
// ),
|
|
|
|
// GoRoute(
|
|
|
|
// path: DocumentosSolicitadosScreen.path,
|
|
|
|
// pageBuilder: (_, state) => transitionScreen(
|
|
|
|
// state.pageKey,
|
|
|
|
// child: const DocumentosSolicitadosScreen(),
|
|
|
|
// )
|
|
|
|
// ),
|
|
|
|
// GoRoute(
|
|
|
|
// path: DocumentosArquivadoScreen.path,
|
|
|
|
// pageBuilder: (_, state) => transitionScreen(
|
|
|
|
// state.pageKey,
|
|
|
|
// child: const DocumentosArquivadoScreen(),
|
|
|
|
// )
|
|
|
|
// ),
|
|
|
|
// GoRoute(
|
|
|
|
// path: DocumentosLixeiraScreen.path,
|
|
|
|
// pageBuilder: (_, state) => transitionScreen(
|
|
|
|
// state.pageKey,
|
|
|
|
// child: const DocumentosLixeiraScreen(),
|
|
|
|
// )
|
|
|
|
// ),
|
|
|
|
// GoRoute(
|
|
|
|
// path: DocumentosVencidosScreen.path,
|
|
|
|
// pageBuilder: (_, state) => transitionScreen(
|
|
|
|
// state.pageKey,
|
|
|
|
// child: const DocumentosVencidosScreen(),
|
|
|
|
// )
|
|
|
|
// ),
|
|
|
|
// GoRoute(
|
|
|
|
// path: BaseProfileScreen.path,
|
|
|
|
// pageBuilder: (_, state) => transitionScreen(
|
|
|
|
// state.pageKey,
|
|
|
|
// child: const BaseProfileScreen(),
|
|
|
|
// )
|
|
|
|
// )
|
|
|
|
]
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
CustomTransitionPage transitionScreen(LocalKey key, {required Widget child}){
|
|
|
|
return CustomTransitionPage(
|
|
|
|
key: key,
|
|
|
|
child: child,
|
|
|
|
transitionsBuilder: (context, animation, secondaryAnimation, child) {
|
|
|
|
return FadeTransition(
|
|
|
|
opacity: CurveTween(
|
|
|
|
curve: Curves.ease
|
|
|
|
// curve: Curves.easeInOutCirc
|
|
|
|
).animate(animation),
|
|
|
|
child: child,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|