From 77aa3de8a465861824edee9d186de6b8711a378a Mon Sep 17 00:00:00 2001 From: JAugustoM Date: Mon, 16 Dec 2024 21:31:25 -0300 Subject: [PATCH] [FEAT] Rota de login adicionada ao menu --- catavento/lib/constants.dart | 2 +- catavento/lib/main.dart | 3 +-- catavento/lib/shared/widgets/menu.dart | 9 ++++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/catavento/lib/constants.dart b/catavento/lib/constants.dart index b54b747..5bb7c48 100644 --- a/catavento/lib/constants.dart +++ b/catavento/lib/constants.dart @@ -1,6 +1,6 @@ const loginRoute = "/login/"; const homeRoute = "/home/"; -const crudFuncionariosRoute = "/dashboardEmployees"; +const crudFuncionariosRoute = "/dashboardEmployees/"; const supabaseUrl = 'https://gfxmrqhwjqekfzrlurqr.supabase.co'; const supabaseKey = String.fromEnvironment('ANON_KEY'); const timeFormat = 'yyyy-MM-dd HH:mm:ss'; diff --git a/catavento/lib/main.dart b/catavento/lib/main.dart index 2656787..e69dbaf 100644 --- a/catavento/lib/main.dart +++ b/catavento/lib/main.dart @@ -1,6 +1,5 @@ import 'package:catavento/bloc/demanda_bloc.dart'; import 'package:catavento/constants.dart'; -import 'package:catavento/views/login_view.dart'; import 'screens/DashboardAdmin/dashboard_admin.dart'; import 'package:catavento/screens/Login/login.dart'; import 'package:catavento/screens/dashboardFuncionarios/employee-management.dart'; @@ -21,7 +20,7 @@ void main() { ), home: const LoadView(), routes: { - loginRoute: (context) => const LoginView(), + loginRoute: (context) => const Login(), homeRoute: (context) => const DashBoardAdmin(), crudFuncionariosRoute: (context) => EmployeeManagement(), }, diff --git a/catavento/lib/shared/widgets/menu.dart b/catavento/lib/shared/widgets/menu.dart index e0f9862..11e4710 100644 --- a/catavento/lib/shared/widgets/menu.dart +++ b/catavento/lib/shared/widgets/menu.dart @@ -1,3 +1,4 @@ +import 'package:catavento/constants.dart'; import 'package:flutter/material.dart'; class Navbar extends StatelessWidget { @@ -28,13 +29,13 @@ class Navbar extends StatelessWidget { ListTile( title: const Text('Demandas'), onTap: () { - Navigator.pushNamed(context, '/home/'); + Navigator.pushNamed(context, homeRoute); }, ), ListTile( title: const Text('Funcionários'), onTap: () { - Navigator.pushNamed(context, '/dashboardEmployees'); + Navigator.pushNamed(context, crudFuncionariosRoute); }, ), ListTile( @@ -43,7 +44,9 @@ class Navbar extends StatelessWidget { ), ListTile( title: const Text('Sair da Conta'), - onTap: () {}, + onTap: () { + Navigator.pushNamed(context, loginRoute); + }, ), ], ),