From a0b5ac3e60e580f49c81eaf7e28b5561e7dc7891 Mon Sep 17 00:00:00 2001 From: Leticia-Arisa-K-Higa Date: Tue, 10 Dec 2024 18:22:18 -0300 Subject: [PATCH 01/16] =?UTF-8?q?Cria=C3=A7=C3=A3o=20do=20componente=20Blo?= =?UTF-8?q?cks=20e=20a=20estrutura=20da=20pagina=20de=20gerenciamento=20de?= =?UTF-8?q?=20funcionarios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboardAdmin/components/background.dart | 41 ++++++++ .../dashboardAdmin/components/blocks.dart | 47 +++++++++ .../dashboardAdmin/dashboard_admin.dart | 2 + .../lib/screens/employee-management.dart | 97 +++++++++++++++++++ 4 files changed, 187 insertions(+) create mode 100644 catavento/lib/screens/dashboardAdmin/components/background.dart create mode 100644 catavento/lib/screens/dashboardAdmin/components/blocks.dart create mode 100644 catavento/lib/screens/employee-management.dart diff --git a/catavento/lib/screens/dashboardAdmin/components/background.dart b/catavento/lib/screens/dashboardAdmin/components/background.dart new file mode 100644 index 0000000..e1c2787 --- /dev/null +++ b/catavento/lib/screens/dashboardAdmin/components/background.dart @@ -0,0 +1,41 @@ +import 'package:flutter/material.dart'; + +class BackgroundPage extends StatelessWidget { + final Color? backgroundColor; + final List? gradientColors; + final Listchildren; + + BackgroundPage({ + this.backgroundColor, + this.gradientColors, + required this.children, + }); + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + //Cor de fundo + Container( + width: double.infinity, + height: double.infinity, + decoration: BoxDecoration( + color: backgroundColor, + gradient: gradientColors != null + ? LinearGradient( + colors: gradientColors!, + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + ) + : null, + ), + ), + + //Conteúdo + Column( + children: children, + ) + ], + ); + } +} diff --git a/catavento/lib/screens/dashboardAdmin/components/blocks.dart b/catavento/lib/screens/dashboardAdmin/components/blocks.dart new file mode 100644 index 0000000..c3d4276 --- /dev/null +++ b/catavento/lib/screens/dashboardAdmin/components/blocks.dart @@ -0,0 +1,47 @@ +import 'package:flutter/material.dart'; + +class Blocks extends StatefulWidget { + final double? height; + final double? width; + final double borderRadius; + final Color color; + final String? title; + + Blocks({ + this.height, + this.width, + this.borderRadius = 16.0, + required this.color, + this.title, + }); + + @override + State createState() { + return BlocksState(); + } +} + +class BlocksState extends State { + + @override + Widget build(BuildContext context) { + double screenWidth = MediaQuery.of(context).size.width; + double screenHeight = MediaQuery.of(context).size.height; + + double blockWidth = widget.width ?? screenWidth * 0.9; + double blockHeight = widget.height ?? screenHeight * 0.5; + + return Container( + width: blockWidth, + height: blockHeight, + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: widget.color, + borderRadius: BorderRadius.circular(widget.borderRadius) + ), + ); + + } + + +} \ No newline at end of file diff --git a/catavento/lib/screens/dashboardAdmin/dashboard_admin.dart b/catavento/lib/screens/dashboardAdmin/dashboard_admin.dart index ae6ff47..5de321e 100644 --- a/catavento/lib/screens/dashboardAdmin/dashboard_admin.dart +++ b/catavento/lib/screens/dashboardAdmin/dashboard_admin.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:catavento/bloc/demanda_bloc.dart'; import 'package:catavento/bloc/demanda_controller.dart'; +import 'package:catavento/screens/employee-management.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:intl/intl.dart'; @@ -199,6 +200,7 @@ class IconMenuState extends State { iconSize: 50, onPressed: () { //Logica do menu + }, icon: Icon(Icons.menu), color: Color(0xFF015C98), diff --git a/catavento/lib/screens/employee-management.dart b/catavento/lib/screens/employee-management.dart new file mode 100644 index 0000000..aa8b341 --- /dev/null +++ b/catavento/lib/screens/employee-management.dart @@ -0,0 +1,97 @@ +import 'dart:ffi'; + +import 'package:flutter/material.dart'; +import 'components/background.dart'; +import 'components/header.dart'; +import 'components/blocks.dart'; + +class EmployeeManagement extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Scaffold( + body: BackgroundPage( + gradientColors: [Color(0xFF75CDF3), Color(0xFFB2E8FF)] , + children: [ + Header(title: "Funcionários"), + + SizedBox(height: MediaQuery.of(context).size.height * 0.05), + + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Blocks( + color: Colors.white, + height: 97, + width: 321, + borderRadius: 26, + ), + + SizedBox(height: MediaQuery.of(context).size.height * 0.02), + + Blocks( + color: Colors.white, + height: 97, + width: 321, + borderRadius: 26, + ), + + SizedBox(height: MediaQuery.of(context).size.height * 0.02), + + SizedBox( + height: MediaQuery.of(context).size.height * 0.07, + width: MediaQuery.of(context).size.width * 0.25, + child: ElevatedButton( + onPressed: () { + //Logica do botão + }, + style: ElevatedButton.styleFrom( + backgroundColor: Color(0xFF015C98), + padding: EdgeInsets.all(16), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(26) + ) + ), + child: Text( + "Cadastrar funcionário", + style: TextStyle( + fontSize: 16, + color: Colors.white + ), + ) + ), + ) + ], + ), + + SizedBox(width: MediaQuery.of(context).size.height * 0.07), + + + Blocks( + color: Colors.white, + height: 559, + width: 346, + borderRadius: 26, + ), + + SizedBox(width: MediaQuery.of(context).size.height * 0.07), + + Blocks( + color: Colors.white, + height: 559, + width: 380, + borderRadius: 26, + ) + + ], + ) + ] + ), + ); + } +} \ No newline at end of file From a2e5065b458e693d0fbe497a93f5f3a7ed9e45b7 Mon Sep 17 00:00:00 2001 From: Leticia-Arisa-K-Higa Date: Thu, 12 Dec 2024 13:50:48 -0300 Subject: [PATCH 02/16] fix: Componente Blocks --- .../dashboardAdmin/components/blocks.dart | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/catavento/lib/screens/dashboardAdmin/components/blocks.dart b/catavento/lib/screens/dashboardAdmin/components/blocks.dart index c3d4276..395af4e 100644 --- a/catavento/lib/screens/dashboardAdmin/components/blocks.dart +++ b/catavento/lib/screens/dashboardAdmin/components/blocks.dart @@ -5,14 +5,14 @@ class Blocks extends StatefulWidget { final double? width; final double borderRadius; final Color color; - final String? title; + final List children; Blocks({ this.height, this.width, this.borderRadius = 16.0, required this.color, - this.title, + required this.children, }); @override @@ -31,17 +31,20 @@ class BlocksState extends State { double blockWidth = widget.width ?? screenWidth * 0.9; double blockHeight = widget.height ?? screenHeight * 0.5; - return Container( - width: blockWidth, - height: blockHeight, - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: widget.color, - borderRadius: BorderRadius.circular(widget.borderRadius) - ), + return Stack( + children: [ + Container( + width: blockWidth, + height: blockHeight, + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: widget.color, + borderRadius: BorderRadius.circular(widget.borderRadius) + ), + ), + + ...widget.children, + ], ); - } - - } \ No newline at end of file From 459e76b20ba8591d7718454aff4a248ea919da8f Mon Sep 17 00:00:00 2001 From: Leticia-Arisa-K-Higa Date: Thu, 12 Dec 2024 13:51:24 -0300 Subject: [PATCH 03/16] Componente graficInfo --- .../dashboardAdmin/components/graficInfo.dart | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 catavento/lib/screens/dashboardAdmin/components/graficInfo.dart diff --git a/catavento/lib/screens/dashboardAdmin/components/graficInfo.dart b/catavento/lib/screens/dashboardAdmin/components/graficInfo.dart new file mode 100644 index 0000000..684ffae --- /dev/null +++ b/catavento/lib/screens/dashboardAdmin/components/graficInfo.dart @@ -0,0 +1,79 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; + + +class Graficinfo, S> extends StatefulWidget { + final IconData icons; + final Color colorIcons; + final String info; + final String? dataKey; + final BlocBuilderCondition? buildWhen; + + Graficinfo ({ + required this.icons, + required this.colorIcons, + required this.info, + this.dataKey, + this.buildWhen, + + }); + + @override + State> createState() { + return GraficinfoState(); + } +} + +class GraficinfoState, S> extends State> { + @override + Widget build(BuildContext context) { + return BlocBuilder( + buildWhen: widget.buildWhen, + builder: (context, response) { + final metaData = (response as dynamic).metaData; + + return Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: + EdgeInsets.only(top: 30.0, bottom: 10.0, left: 60.0), + child: Icon( + widget.icons, + size: 80.0, + color: widget.colorIcons, + ), + ), + SizedBox( + width: 40, + ), + Padding( + padding: EdgeInsets.only(top: 25.0, right: 20.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + "${metaData[widget.dataKey] ?? '--'}", + style: TextStyle( + fontSize: 30, + fontWeight: FontWeight.bold, + color: Colors.black, + ), + ), + SizedBox( + height: 2, + ), + Text( + widget.info, + style: + TextStyle(fontSize: 18, color: Colors.black), + ) + ], + ) + ), + ], + ); + } + ); + } +} \ No newline at end of file From 6c72cd60136fab86a264ea702ca091be6309e048 Mon Sep 17 00:00:00 2001 From: Leticia-Arisa-K-Higa Date: Sat, 14 Dec 2024 08:15:06 -0300 Subject: [PATCH 04/16] Componente showdialog --- .../dashboardAdmin/components/showDialog.dart | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 catavento/lib/screens/dashboardAdmin/components/showDialog.dart diff --git a/catavento/lib/screens/dashboardAdmin/components/showDialog.dart b/catavento/lib/screens/dashboardAdmin/components/showDialog.dart new file mode 100644 index 0000000..bf100d1 --- /dev/null +++ b/catavento/lib/screens/dashboardAdmin/components/showDialog.dart @@ -0,0 +1,70 @@ +import 'package:flutter/material.dart'; + +class Showdialog extends StatelessWidget { + final double? height; + final double? width; + final String title; + final List? children; + + Showdialog({ + this.height, + this.width, + required this.title, + this.children, + }); + + @override + Widget build(BuildContext context) { + double screenWidth = MediaQuery.of(context).size.width; + double screenHeight = MediaQuery.of(context).size.height; + + double blockWidth = width ?? screenWidth * 0.9; + double blockHeight = height ?? screenHeight * 0.5; + + return Stack( + children: [ + AlertDialog( + backgroundColor: Color(0xFFD1EEFF), + content: SizedBox( + width: blockWidth, + height: blockHeight, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Título e botão de fechar + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Align( + alignment: Alignment.center, + child: Text( + title, + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + IconButton( + onPressed: () { + Navigator.pop(context); + }, + icon: Icon( + Icons.close, + size: 25, + ), + ), + ], + ), + ...?children, + ], + ), + ), + ), + ], + ); + } +} From 35ec821e65fa0517566b9513b81417e84331694a Mon Sep 17 00:00:00 2001 From: Leticia-Arisa-K-Higa Date: Sat, 14 Dec 2024 08:39:35 -0300 Subject: [PATCH 05/16] =?UTF-8?q?Modifica=C3=A7=C3=A3o=20no=20employee-man?= =?UTF-8?q?agement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/screens/employee-management.dart | 48 +++++++++++++++++-- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/catavento/lib/screens/employee-management.dart b/catavento/lib/screens/employee-management.dart index aa8b341..4081144 100644 --- a/catavento/lib/screens/employee-management.dart +++ b/catavento/lib/screens/employee-management.dart @@ -1,9 +1,11 @@ import 'dart:ffi'; +import 'package:catavento/screens/components/graficInfo.dart'; import 'package:flutter/material.dart'; import 'components/background.dart'; import 'components/header.dart'; import 'components/blocks.dart'; +import 'components/showDialog.dart'; class EmployeeManagement extends StatelessWidget { @override @@ -30,16 +32,44 @@ class EmployeeManagement extends StatelessWidget { height: 97, width: 321, borderRadius: 26, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Icon( + Icons.group, + size: 30, + color: Color(0xFF015C98), + ), + + SizedBox(width: MediaQuery.of(context).size.height * 0.04), + + Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + + ], + ) + ], + ) + ], ), SizedBox(height: MediaQuery.of(context).size.height * 0.02), - Blocks( + /*Blocks( color: Colors.white, height: 97, width: 321, borderRadius: 26, - ), + children: [ + + ], + ),*/ SizedBox(height: MediaQuery.of(context).size.height * 0.02), @@ -49,6 +79,16 @@ class EmployeeManagement extends StatelessWidget { child: ElevatedButton( onPressed: () { //Logica do botão + showDialog( + context: context, + builder: (BuildContext context) { + return Showdialog( + width: 463, + height: 402, + title: 'Novo funcionário', + ); + }, + ); }, style: ElevatedButton.styleFrom( backgroundColor: Color(0xFF015C98), @@ -72,7 +112,7 @@ class EmployeeManagement extends StatelessWidget { SizedBox(width: MediaQuery.of(context).size.height * 0.07), - Blocks( + /*Blocks( color: Colors.white, height: 559, width: 346, @@ -86,7 +126,7 @@ class EmployeeManagement extends StatelessWidget { height: 559, width: 380, borderRadius: 26, - ) + )*/ ], ) From 9f51602e4bc6b0109fa9040f55dfccf7e06d65d0 Mon Sep 17 00:00:00 2001 From: Leticia-Arisa-K-Higa Date: Sat, 14 Dec 2024 08:52:38 -0300 Subject: [PATCH 06/16] Blocks comentario --- catavento/lib/screens/employee-management.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/catavento/lib/screens/employee-management.dart b/catavento/lib/screens/employee-management.dart index 4081144..383e1d1 100644 --- a/catavento/lib/screens/employee-management.dart +++ b/catavento/lib/screens/employee-management.dart @@ -117,6 +117,7 @@ class EmployeeManagement extends StatelessWidget { height: 559, width: 346, borderRadius: 26, + children[] ), SizedBox(width: MediaQuery.of(context).size.height * 0.07), @@ -126,6 +127,7 @@ class EmployeeManagement extends StatelessWidget { height: 559, width: 380, borderRadius: 26, + children[] )*/ ], From b754728c2e387c9d67fc9151725ab0ceff252e72 Mon Sep 17 00:00:00 2001 From: samaralves1 Date: Fri, 13 Dec 2024 22:03:20 -0300 Subject: [PATCH 07/16] Adicionando 'children' --- .../lib/screens/employee-management.dart | 41 ++++++------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/catavento/lib/screens/employee-management.dart b/catavento/lib/screens/employee-management.dart index 383e1d1..43db8cf 100644 --- a/catavento/lib/screens/employee-management.dart +++ b/catavento/lib/screens/employee-management.dart @@ -12,16 +12,13 @@ class EmployeeManagement extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( body: BackgroundPage( - gradientColors: [Color(0xFF75CDF3), Color(0xFFB2E8FF)] , + gradientColors: [Color(0xFF75CDF3), Color(0xFFB2E8FF)], children: [ Header(title: "Funcionários"), - SizedBox(height: MediaQuery.of(context).size.height * 0.05), - Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, - children: [ Column( mainAxisAlignment: MainAxisAlignment.start, @@ -36,29 +33,23 @@ class EmployeeManagement extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, - children: [ Icon( Icons.group, size: 30, color: Color(0xFF015C98), ), - - SizedBox(width: MediaQuery.of(context).size.height * 0.04), - + SizedBox( + width: MediaQuery.of(context).size.height * 0.04), Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, - - children: [ - - ], + children: [], ) ], ) ], ), - SizedBox(height: MediaQuery.of(context).size.height * 0.02), /*Blocks( @@ -72,7 +63,6 @@ class EmployeeManagement extends StatelessWidget { ),*/ SizedBox(height: MediaQuery.of(context).size.height * 0.02), - SizedBox( height: MediaQuery.of(context).size.height * 0.07, width: MediaQuery.of(context).size.width * 0.25, @@ -94,24 +84,18 @@ class EmployeeManagement extends StatelessWidget { backgroundColor: Color(0xFF015C98), padding: EdgeInsets.all(16), shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(26) - ) + borderRadius: BorderRadius.circular(26)), ), child: Text( "Cadastrar funcionário", - style: TextStyle( - fontSize: 16, - color: Colors.white - ), - ) - ), - ) + style: TextStyle(fontSize: 16, color: Colors.white), + ), + ), + ), ], ), - SizedBox(width: MediaQuery.of(context).size.height * 0.07), - /*Blocks( color: Colors.white, height: 559, @@ -129,11 +113,10 @@ class EmployeeManagement extends StatelessWidget { borderRadius: 26, children[] )*/ - ], - ) - ] + ), + ], ), ); } -} \ No newline at end of file +} From a64bbf248b6790e6afbe95ec19c293aa57ad67d7 Mon Sep 17 00:00:00 2001 From: Danielle Soares Date: Sat, 14 Dec 2024 17:19:47 -0300 Subject: [PATCH 08/16] fix: bug do menu desapareceu --- .vscode/settings.json | 2 +- catavento/lib/screens/dashboardAdmin/dashboard_admin.dart | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 2fa9402..874a441 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "cmake.sourceDirectory": "/home/melkor/Desktop/schl/4semestre/MDS/GITHUB/2024.2-Fehu/catavento/linux" + "cmake.sourceDirectory": "C:/FlutterProjects/fehu/2024.2-Fehu/catavento/linux" } \ No newline at end of file diff --git a/catavento/lib/screens/dashboardAdmin/dashboard_admin.dart b/catavento/lib/screens/dashboardAdmin/dashboard_admin.dart index 5de321e..ae6ff47 100644 --- a/catavento/lib/screens/dashboardAdmin/dashboard_admin.dart +++ b/catavento/lib/screens/dashboardAdmin/dashboard_admin.dart @@ -2,7 +2,6 @@ import 'dart:io'; import 'package:catavento/bloc/demanda_bloc.dart'; import 'package:catavento/bloc/demanda_controller.dart'; -import 'package:catavento/screens/employee-management.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:intl/intl.dart'; @@ -200,7 +199,6 @@ class IconMenuState extends State { iconSize: 50, onPressed: () { //Logica do menu - }, icon: Icon(Icons.menu), color: Color(0xFF015C98), From 3d98a080b08899d0c6431f9af5e1379ee6458a39 Mon Sep 17 00:00:00 2001 From: Danielle Soares Date: Sat, 14 Dec 2024 17:28:09 -0300 Subject: [PATCH 09/16] =?UTF-8?q?fix:=20rota=20para=20a=20pag.=20de=20admi?= =?UTF-8?q?nistra=C3=A7=C3=A3o=20dos=20funcion=C3=A1rios=20funcionando?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- catavento/lib/main.dart | 4 ++-- catavento/lib/screens/employee-management.dart | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/catavento/lib/main.dart b/catavento/lib/main.dart index e23ebe6..e5c3e9c 100644 --- a/catavento/lib/main.dart +++ b/catavento/lib/main.dart @@ -2,7 +2,7 @@ import 'package:catavento/bloc/demanda_bloc.dart'; import 'package:catavento/constants.dart'; import 'package:catavento/screens/Login/login.dart'; import 'package:catavento/screens/dashboardAdmin/dashboard_admin.dart'; -import 'package:catavento/screens/dashboardFuncionarios/dashboard_funcionarios.dart'; +import 'package:catavento/screens/employee-management.dart'; import 'package:catavento/views/login_view.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -23,7 +23,7 @@ void main() { routes: { loginRoute: (context) => const LoginView(), homeRoute: (context) => const DashBoardAdmin(), - crudFuncionariosRoute: (context) => const DashBoardFuncionarios(), + crudFuncionariosRoute: (context) => const EmployeeManagement(), }, ), ), diff --git a/catavento/lib/screens/employee-management.dart b/catavento/lib/screens/employee-management.dart index 43db8cf..2cc6c9b 100644 --- a/catavento/lib/screens/employee-management.dart +++ b/catavento/lib/screens/employee-management.dart @@ -1,6 +1,3 @@ -import 'dart:ffi'; - -import 'package:catavento/screens/components/graficInfo.dart'; import 'package:flutter/material.dart'; import 'components/background.dart'; import 'components/header.dart'; @@ -8,6 +5,7 @@ import 'components/blocks.dart'; import 'components/showDialog.dart'; class EmployeeManagement extends StatelessWidget { + const EmployeeManagement({super.key}); @override Widget build(BuildContext context) { return Scaffold( From 98408c57c89c5dffb8cf767a342039fb27b05ce8 Mon Sep 17 00:00:00 2001 From: Danielle Soares Date: Sat, 14 Dec 2024 17:40:29 -0300 Subject: [PATCH 10/16] =?UTF-8?q?fix:=20rota=20para=20p=C3=A1gina=20de=20d?= =?UTF-8?q?emandas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/screens/employee-management.dart | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/catavento/lib/screens/employee-management.dart b/catavento/lib/screens/employee-management.dart index 2cc6c9b..732095e 100644 --- a/catavento/lib/screens/employee-management.dart +++ b/catavento/lib/screens/employee-management.dart @@ -3,12 +3,57 @@ import 'components/background.dart'; import 'components/header.dart'; import 'components/blocks.dart'; import 'components/showDialog.dart'; +import 'package:catavento/screens/components/menu.dart'; class EmployeeManagement extends StatelessWidget { const EmployeeManagement({super.key}); @override Widget build(BuildContext context) { return Scaffold( + drawer: Navbar(), + appBar: AppBar( + backgroundColor: Colors.transparent, + elevation: 0, + iconTheme: const IconThemeData( + color: Color(0xFF015C98), + ), + leading: Builder( + builder: (BuildContext context) { + return Padding( + padding: const EdgeInsets.only(left: 20), // Padding aqui + child: Material( + color: Colors.transparent, // Mantém o fundo transparente + child: InkWell( + onTap: () { + Scaffold.of(context).openDrawer(); // Abre o Drawer + }, + ), + ), + ); + }, + ), + actions: [ + Padding( + padding: const EdgeInsets.only( + right: 20), // Ajuste o valor conforme necessário + child: TextButton.icon( + icon: const Icon(Icons.history, size: 18.0), + label: const Text("Ver Histórico"), + onPressed: () {}, + style: TextButton.styleFrom( + foregroundColor: Colors.white, + backgroundColor: const Color(0xFF015C98), + padding: + const EdgeInsets.symmetric(horizontal: 15, vertical: 10), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30), + ), + ), + ), + ), + ], + ), + extendBodyBehindAppBar: true, body: BackgroundPage( gradientColors: [Color(0xFF75CDF3), Color(0xFFB2E8FF)], children: [ From 16c57d97b29c6699a21e02788894c2f6da0ca383 Mon Sep 17 00:00:00 2001 From: Leticia-Arisa-K-Higa Date: Sat, 14 Dec 2024 22:22:52 -0300 Subject: [PATCH 11/16] =?UTF-8?q?fix:=20Estrutura=20da=20pagina=20de=20ger?= =?UTF-8?q?enciamento=20de=20funcion=C3=A1rios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboardAdmin/components/blocks.dart | 33 +++++++++++-- .../dashboardAdmin/components/graficInfo.dart | 48 ++++++++---------- .../lib/screens/employee-management.dart | 49 ++----------------- 3 files changed, 54 insertions(+), 76 deletions(-) diff --git a/catavento/lib/screens/dashboardAdmin/components/blocks.dart b/catavento/lib/screens/dashboardAdmin/components/blocks.dart index 395af4e..fae97c1 100644 --- a/catavento/lib/screens/dashboardAdmin/components/blocks.dart +++ b/catavento/lib/screens/dashboardAdmin/components/blocks.dart @@ -1,18 +1,22 @@ +import 'dart:ffi'; + import 'package:flutter/material.dart'; class Blocks extends StatefulWidget { + final String? title; final double? height; final double? width; final double borderRadius; final Color color; - final List children; + final Widget child; Blocks({ + this.title, this.height, this.width, this.borderRadius = 16.0, required this.color, - required this.children, + required this.child, }); @override @@ -43,7 +47,30 @@ class BlocksState extends State { ), ), - ...widget.children, + if (widget.title != null) + Positioned( + top: 10, + left: 0, + right: 0, + child: Center( + child: Text( + widget.title!, + style: TextStyle( + fontSize: 16, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + + Positioned.fill( + child: Align( + alignment: Alignment.center, + child: widget.child, + ), + ), + ], ); } diff --git a/catavento/lib/screens/dashboardAdmin/components/graficInfo.dart b/catavento/lib/screens/dashboardAdmin/components/graficInfo.dart index 684ffae..0525001 100644 --- a/catavento/lib/screens/dashboardAdmin/components/graficInfo.dart +++ b/catavento/lib/screens/dashboardAdmin/components/graficInfo.dart @@ -3,18 +3,20 @@ import 'package:flutter_bloc/flutter_bloc.dart'; class Graficinfo, S> extends StatefulWidget { + final double? size; final IconData icons; final Color colorIcons; final String info; - final String? dataKey; - final BlocBuilderCondition? buildWhen; + final String dataKey; + final BlocBuilderCondition buildWhen; Graficinfo ({ + this.size, required this.icons, required this.colorIcons, required this.info, - this.dataKey, - this.buildWhen, + required this.dataKey, + required this.buildWhen, }); @@ -33,24 +35,19 @@ class GraficinfoState, S> extends State> final metaData = (response as dynamic).metaData; return Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Padding( - padding: - EdgeInsets.only(top: 30.0, bottom: 10.0, left: 60.0), - child: Icon( - widget.icons, - size: 80.0, - color: widget.colorIcons, - ), - ), - SizedBox( - width: 40, + Icon( + widget.icons, + size: widget.size, + color: widget.colorIcons, ), - Padding( - padding: EdgeInsets.only(top: 25.0, right: 20.0), + SizedBox(width: 20), + + Center( // Adicionado Center para centralizar o conteúdo dentro do Column child: Column( - crossAxisAlignment: CrossAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.center, // Centralizado horizontalmente children: [ Text( "${metaData[widget.dataKey] ?? '--'}", @@ -60,18 +57,15 @@ class GraficinfoState, S> extends State> color: Colors.black, ), ), - SizedBox( - height: 2, - ), + SizedBox(height: 2), Text( widget.info, - style: - TextStyle(fontSize: 18, color: Colors.black), - ) + style: TextStyle(fontSize: 18, color: Colors.black), + ), ], - ) + ), ), - ], + ] ); } ); diff --git a/catavento/lib/screens/employee-management.dart b/catavento/lib/screens/employee-management.dart index 732095e..43db8cf 100644 --- a/catavento/lib/screens/employee-management.dart +++ b/catavento/lib/screens/employee-management.dart @@ -1,59 +1,16 @@ +import 'dart:ffi'; + +import 'package:catavento/screens/components/graficInfo.dart'; import 'package:flutter/material.dart'; import 'components/background.dart'; import 'components/header.dart'; import 'components/blocks.dart'; import 'components/showDialog.dart'; -import 'package:catavento/screens/components/menu.dart'; class EmployeeManagement extends StatelessWidget { - const EmployeeManagement({super.key}); @override Widget build(BuildContext context) { return Scaffold( - drawer: Navbar(), - appBar: AppBar( - backgroundColor: Colors.transparent, - elevation: 0, - iconTheme: const IconThemeData( - color: Color(0xFF015C98), - ), - leading: Builder( - builder: (BuildContext context) { - return Padding( - padding: const EdgeInsets.only(left: 20), // Padding aqui - child: Material( - color: Colors.transparent, // Mantém o fundo transparente - child: InkWell( - onTap: () { - Scaffold.of(context).openDrawer(); // Abre o Drawer - }, - ), - ), - ); - }, - ), - actions: [ - Padding( - padding: const EdgeInsets.only( - right: 20), // Ajuste o valor conforme necessário - child: TextButton.icon( - icon: const Icon(Icons.history, size: 18.0), - label: const Text("Ver Histórico"), - onPressed: () {}, - style: TextButton.styleFrom( - foregroundColor: Colors.white, - backgroundColor: const Color(0xFF015C98), - padding: - const EdgeInsets.symmetric(horizontal: 15, vertical: 10), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30), - ), - ), - ), - ), - ], - ), - extendBodyBehindAppBar: true, body: BackgroundPage( gradientColors: [Color(0xFF75CDF3), Color(0xFFB2E8FF)], children: [ From d5f607972992441f3044e8386227a87d808d9ce4 Mon Sep 17 00:00:00 2001 From: Leticia-Arisa-K-Higa Date: Sun, 15 Dec 2024 15:22:39 -0300 Subject: [PATCH 12/16] =?UTF-8?q?Cria=C3=A7=C3=A3o=20da=20janela=20"Novo?= =?UTF-8?q?=20Funcionario"=20e=20do=20componente=20input?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboardAdmin/components/input.dart | 61 ++++++++++++++++ .../dashboardAdmin/components/showDialog.dart | 9 ++- .../lib/screens/employee-management.dart | 71 ++++++++++++++++++- 3 files changed, 137 insertions(+), 4 deletions(-) create mode 100644 catavento/lib/screens/dashboardAdmin/components/input.dart diff --git a/catavento/lib/screens/dashboardAdmin/components/input.dart b/catavento/lib/screens/dashboardAdmin/components/input.dart new file mode 100644 index 0000000..e5761e1 --- /dev/null +++ b/catavento/lib/screens/dashboardAdmin/components/input.dart @@ -0,0 +1,61 @@ +import 'package:flutter/material.dart'; + +class Inputs extends StatefulWidget { + final String text; + final String hint; + + Inputs({ + required this.text, + required this.hint, + }); + + @override + State createState() { + return InputsState(); + } +} + +class InputsState extends State{ + @override + Widget build(BuildContext context) { + + return Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + widget.text, + style: TextStyle( + fontSize: 15, + color: Colors.black + ), + ), + + SizedBox(width: 4,), + + Expanded( + child: SizedBox( + height: 33, + child: TextField( + decoration: InputDecoration( + hintStyle: TextStyle( + fontSize: 15, + color: Colors.grey + ), + hintText: widget.hint, + filled: true, + fillColor: Colors.white, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(10) + ), + contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10) + ), + ), + ) + + ), + ], + ); + } +} \ No newline at end of file diff --git a/catavento/lib/screens/dashboardAdmin/components/showDialog.dart b/catavento/lib/screens/dashboardAdmin/components/showDialog.dart index bf100d1..39710ed 100644 --- a/catavento/lib/screens/dashboardAdmin/components/showDialog.dart +++ b/catavento/lib/screens/dashboardAdmin/components/showDialog.dart @@ -4,13 +4,13 @@ class Showdialog extends StatelessWidget { final double? height; final double? width; final String title; - final List? children; + final Widget? child; Showdialog({ this.height, this.width, required this.title, - this.children, + this.child, }); @override @@ -59,7 +59,10 @@ class Showdialog extends StatelessWidget { ), ], ), - ...?children, + + SizedBox( height: MediaQuery.of(context).size.height * 0.05), + + child!, ], ), ), diff --git a/catavento/lib/screens/employee-management.dart b/catavento/lib/screens/employee-management.dart index 43db8cf..b3df7c9 100644 --- a/catavento/lib/screens/employee-management.dart +++ b/catavento/lib/screens/employee-management.dart @@ -1,6 +1,9 @@ import 'dart:ffi'; - +import 'package:catavento/bloc/usuario_bloc.dart'; +import 'package:catavento/screens/components/confirmDialog.dart'; import 'package:catavento/screens/components/graficInfo.dart'; +import 'package:catavento/screens/components/input.dart'; +import 'package:catavento/screens/dashboard_admin.dart'; import 'package:flutter/material.dart'; import 'components/background.dart'; import 'components/header.dart'; @@ -76,6 +79,72 @@ class EmployeeManagement extends StatelessWidget { width: 463, height: 402, title: 'Novo funcionário', + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Inputs( + text: "Nome:", + hint: "Nome do funcionário", + ), + SizedBox( + height: + MediaQuery.of(context).size.height * + 0.02), + Inputs( + text: "Setor:", + hint: "Setor do funcionário", + ), + SizedBox( + height: + MediaQuery.of(context).size.height * + 0.02), + Inputs( + text: "Email:", + hint: "Email do funcionário", + ), + SizedBox( + height: + MediaQuery.of(context).size.height * + 0.02), + Inputs( + text: "Nome de usuário:", + hint: "Nome de usuário do funcionário", + ), + SizedBox( + height: + MediaQuery.of(context).size.height * + 0.02), + Inputs( + text: "Senha:", + hint: "Senha para o funcionário", + ), + SizedBox( + height: + MediaQuery.of(context).size.height * + 0.08), + Positioned.fill( + child: Center( + child: ElevatedButton( + onPressed: () { + //Lógica do botão + Navigator.pop(context); + }, + style: ElevatedButton.styleFrom( + backgroundColor: + Colors.green, + shape: + RoundedRectangleBorder( + borderRadius: + BorderRadius + .circular( + 22))), + child: Text( + "Cadastrar", + style: TextStyle( + color: Colors.white), + )))) + ]), ); }, ); From 0fae8c30bbfb1f8bf07729dd94c5e87adddf6194 Mon Sep 17 00:00:00 2001 From: Leticia-Arisa-K-Higa Date: Mon, 16 Dec 2024 10:39:36 -0300 Subject: [PATCH 13/16] FuncionarioCard --- catavento/lib/main.dart | 2 +- .../components/funcionarioCard.dart | 66 +++++++++++++++++++ .../lib/screens/employee-management.dart | 30 ++++++++- 3 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 catavento/lib/screens/dashboardAdmin/components/funcionarioCard.dart diff --git a/catavento/lib/main.dart b/catavento/lib/main.dart index e5c3e9c..3ad67cf 100644 --- a/catavento/lib/main.dart +++ b/catavento/lib/main.dart @@ -23,7 +23,7 @@ void main() { routes: { loginRoute: (context) => const LoginView(), homeRoute: (context) => const DashBoardAdmin(), - crudFuncionariosRoute: (context) => const EmployeeManagement(), + crudFuncionariosRoute: (context) => EmployeeManagement(), }, ), ), diff --git a/catavento/lib/screens/dashboardAdmin/components/funcionarioCard.dart b/catavento/lib/screens/dashboardAdmin/components/funcionarioCard.dart new file mode 100644 index 0000000..dcbccef --- /dev/null +++ b/catavento/lib/screens/dashboardAdmin/components/funcionarioCard.dart @@ -0,0 +1,66 @@ +import 'package:flutter/material.dart'; +import 'confirmDialog.dart'; + + +class FuncionarioCard extends StatelessWidget { + final String nomeFuncionario; + final String status; + final String setor; + const FuncionarioCard({ + super.key, + required this.nomeFuncionario, + required this.setor, + required this.status, + }); + + @override + Widget build(BuildContext context) { + + return Card( + margin: EdgeInsets.symmetric(vertical: 8.0), + child: ListTile( + title: Text(nomeFuncionario), + subtitle: Text( + 'Código: $setor\nStatus: $status'), + trailing: Row( + mainAxisSize: MainAxisSize.min, + children: [ + IconButton( + icon: Icon(Icons.info), + onPressed: () { + //Lógica ao clicar + }, + ), + // botão de Editar. + IconButton( + icon: Icon(Icons.edit), + onPressed: () { + // editar a demanda + + }, + ), + // apagar + IconButton( + icon: Icon(Icons.delete), + onPressed: () async { + showDialog( + context: context, + builder: (BuildContext context) { + return ConfirmDialog( + title: 'Confirmar Exclusão', + contente: + 'Tem certeza de que deseja apagar esta demanda?', + onConfirm: () { + Navigator.of(context).pop(); // Fecha o diálogo + //Lógica do botão + }, + ); + }, + ); + }), + ], + ), + ), + ); + } +} \ No newline at end of file diff --git a/catavento/lib/screens/employee-management.dart b/catavento/lib/screens/employee-management.dart index b3df7c9..db26035 100644 --- a/catavento/lib/screens/employee-management.dart +++ b/catavento/lib/screens/employee-management.dart @@ -5,12 +5,24 @@ import 'package:catavento/screens/components/graficInfo.dart'; import 'package:catavento/screens/components/input.dart'; import 'package:catavento/screens/dashboard_admin.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'components/background.dart'; import 'components/header.dart'; import 'components/blocks.dart'; import 'components/showDialog.dart'; +import 'package:catavento/screens/components/menu.dart'; +import 'components/funcionarioCard.dart'; class EmployeeManagement extends StatelessWidget { + final List> funcionarios = [ + {'nome': 'João Silva', 'setor': 'Corte', 'status': 'Ativo'}, + {'nome': 'Maria Santos', 'setor': 'Montagem', 'status': 'Inativo'}, + {'nome': 'Carlos Oliveira', 'setor': 'Montagem', 'status': 'Ativo'}, + {'nome': 'Carlos Oliveira', 'setor': 'Montagem', 'status': 'Ativo'}, + {'nome': 'Carlos Oliveira', 'setor': 'Montagem', 'status': 'Ativo'}, + {'nome': 'Carlos Oliveira', 'setor': 'Montagem', 'status': 'Ativo'} + ]; + @override Widget build(BuildContext context) { return Scaffold( @@ -170,8 +182,22 @@ class EmployeeManagement extends StatelessWidget { height: 559, width: 346, borderRadius: 26, - children[] - ), + child: SizedBox( + height: 470, + width: 302, + child: ListView.builder( //Aqui vai o cards dos funcionarios cadastrados + itemCount: funcionarios.length, + itemBuilder: (context, index) { + final funcionario = funcionarios[index]; + return FuncionarioCard( + nomeFuncionario: funcionario['nome']!, + setor: funcionario['setor']!, + status: funcionario['status']!, + ); + }, + ) + ) + ), SizedBox(width: MediaQuery.of(context).size.height * 0.07), From 71194d4f564e97e880af16e7171bfdac82115d6b Mon Sep 17 00:00:00 2001 From: Leticia-Arisa-K-Higa Date: Mon, 16 Dec 2024 10:59:08 -0300 Subject: [PATCH 14/16] ativAndamentoCard --- .../components/ativAndamentoCard.dart | 27 +++++++ .../components/funcionarioCard.dart | 2 +- .../lib/screens/employee-management.dart | 79 +++++++++++++++++-- 3 files changed, 99 insertions(+), 9 deletions(-) create mode 100644 catavento/lib/screens/dashboardAdmin/components/ativAndamentoCard.dart diff --git a/catavento/lib/screens/dashboardAdmin/components/ativAndamentoCard.dart b/catavento/lib/screens/dashboardAdmin/components/ativAndamentoCard.dart new file mode 100644 index 0000000..6e54b0f --- /dev/null +++ b/catavento/lib/screens/dashboardAdmin/components/ativAndamentoCard.dart @@ -0,0 +1,27 @@ +import 'package:flutter/material.dart'; + + +class AtivAndamentoCard extends StatelessWidget { + final String nomeFuncionario; + final String nomeDemanda; + + const AtivAndamentoCard({ + super.key, + required this.nomeFuncionario, + required this.nomeDemanda, + }); + + @override + Widget build(BuildContext context) { + + return Card( + margin: EdgeInsets.symmetric(vertical: 8.0), + child: ListTile( + title: Text(nomeFuncionario), + subtitle: Text( + 'Em andamento: $nomeDemanda' + ), + ), + ); + } +} \ No newline at end of file diff --git a/catavento/lib/screens/dashboardAdmin/components/funcionarioCard.dart b/catavento/lib/screens/dashboardAdmin/components/funcionarioCard.dart index dcbccef..4b14f0e 100644 --- a/catavento/lib/screens/dashboardAdmin/components/funcionarioCard.dart +++ b/catavento/lib/screens/dashboardAdmin/components/funcionarioCard.dart @@ -21,7 +21,7 @@ class FuncionarioCard extends StatelessWidget { child: ListTile( title: Text(nomeFuncionario), subtitle: Text( - 'Código: $setor\nStatus: $status'), + 'Setor: $setor\nStatus: $status'), trailing: Row( mainAxisSize: MainAxisSize.min, children: [ diff --git a/catavento/lib/screens/employee-management.dart b/catavento/lib/screens/employee-management.dart index db26035..37e0c06 100644 --- a/catavento/lib/screens/employee-management.dart +++ b/catavento/lib/screens/employee-management.dart @@ -1,5 +1,6 @@ import 'dart:ffi'; import 'package:catavento/bloc/usuario_bloc.dart'; +import 'package:catavento/screens/components/ativAndamentoCard.dart'; import 'package:catavento/screens/components/confirmDialog.dart'; import 'package:catavento/screens/components/graficInfo.dart'; import 'package:catavento/screens/components/input.dart'; @@ -15,12 +16,12 @@ import 'components/funcionarioCard.dart'; class EmployeeManagement extends StatelessWidget { final List> funcionarios = [ - {'nome': 'João Silva', 'setor': 'Corte', 'status': 'Ativo'}, - {'nome': 'Maria Santos', 'setor': 'Montagem', 'status': 'Inativo'}, - {'nome': 'Carlos Oliveira', 'setor': 'Montagem', 'status': 'Ativo'}, - {'nome': 'Carlos Oliveira', 'setor': 'Montagem', 'status': 'Ativo'}, - {'nome': 'Carlos Oliveira', 'setor': 'Montagem', 'status': 'Ativo'}, - {'nome': 'Carlos Oliveira', 'setor': 'Montagem', 'status': 'Ativo'} + {'nome': 'nomeFuncionario', 'setor': 'nomeCargo', 'status': 'Ativo'}, + {'nome': 'nomeFuncionario', 'setor': 'nomeCargo', 'status': 'Ativo'}, + {'nome': 'nomeFuncionario', 'setor': 'nomeCargo', 'status': 'Ativo'}, + {'nome': 'nomeFuncionario', 'setor': 'nomeCargo', 'status': 'Ativo'}, + {'nome': 'nomeFuncionario', 'setor': 'nomeCargo', 'status': 'Ativo'}, + {'nome': 'nomeFuncionario', 'setor': 'nomeCargo', 'status': 'Ativo'} ]; @override @@ -206,8 +207,70 @@ class EmployeeManagement extends StatelessWidget { height: 559, width: 380, borderRadius: 26, - children[] - )*/ + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Center( + child: Center( + child: Text( + "Setor de Montagem", + style: TextStyle( + fontSize: 14, + color: Colors.black, + ), + ), + ), + ), + + SizedBox(height: MediaQuery.of(context).size.height * 0.03), + + SizedBox( + height: 200, + width: 330, + child: ListView.builder( //Aqui vai o card das atividades em andamento (Corte) + itemCount: ativAndamento.length, + itemBuilder: (context, index) { + final atividade = ativAndamento[index]; + return AtivAndamentoCard( + nomeFuncionario: atividade['nome']!, + nomeDemanda: atividade['demanda']!, + ); + }, + ) + ), + + SizedBox(height: MediaQuery.of(context).size.height * 0.03), + + Center( + child: Text( + "Setor de Corte", + style: TextStyle( + fontSize: 14, + color: Colors.black, + ), + ), + ), + + SizedBox(height: MediaQuery.of(context).size.height * 0.03), + + SizedBox( + height: 200, + width: 330, + child: ListView.builder( //Aqui vai os cards das atividades em andamento (Montagem) + itemCount: ativAndamento.length, + itemBuilder: (context, index) { + final atividade = ativAndamento[index]; + return AtivAndamentoCard( + nomeFuncionario: atividade['nome']!, + nomeDemanda: atividade['demanda']!, + ); + }, + ) + ), + + ], + ) + ) ], ), ], From 3cca593385d0710af8172da21a08f714b482f188 Mon Sep 17 00:00:00 2001 From: Leticia-Arisa-K-Higa Date: Mon, 16 Dec 2024 11:13:18 -0300 Subject: [PATCH 15/16] fix: Responsividade dos cards --- catavento/lib/screens/employee-management.dart | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/catavento/lib/screens/employee-management.dart b/catavento/lib/screens/employee-management.dart index 37e0c06..0602fdf 100644 --- a/catavento/lib/screens/employee-management.dart +++ b/catavento/lib/screens/employee-management.dart @@ -184,8 +184,9 @@ class EmployeeManagement extends StatelessWidget { width: 346, borderRadius: 26, child: SizedBox( - height: 470, - width: 302, + height: MediaQuery.of(context).size.height * 0.6, + width: MediaQuery.of(context).size.height * 0.45, + child: ListView.builder( //Aqui vai o cards dos funcionarios cadastrados itemCount: funcionarios.length, itemBuilder: (context, index) { @@ -222,11 +223,9 @@ class EmployeeManagement extends StatelessWidget { ), ), - SizedBox(height: MediaQuery.of(context).size.height * 0.03), - SizedBox( - height: 200, - width: 330, + height: MediaQuery.of(context).size.height * 0.25, + width: MediaQuery.of(context).size.height * 0.5, child: ListView.builder( //Aqui vai o card das atividades em andamento (Corte) itemCount: ativAndamento.length, itemBuilder: (context, index) { @@ -251,11 +250,9 @@ class EmployeeManagement extends StatelessWidget { ), ), - SizedBox(height: MediaQuery.of(context).size.height * 0.03), - SizedBox( - height: 200, - width: 330, + height: MediaQuery.of(context).size.height * 0.3, + width: MediaQuery.of(context).size.height * 0.5, child: ListView.builder( //Aqui vai os cards das atividades em andamento (Montagem) itemCount: ativAndamento.length, itemBuilder: (context, index) { From 3266093f96e95a312a438325b25b0666eda959cd Mon Sep 17 00:00:00 2001 From: Leticia-Arisa-K-Higa Date: Mon, 16 Dec 2024 13:14:41 -0300 Subject: [PATCH 16/16] =?UTF-8?q?Cria=C3=A7=C3=A3o=20da=20janela=20para=20?= =?UTF-8?q?exibi=C3=A7=C3=A3o=20das=20informa=C3=A7=C3=B5es=20dos=20funcio?= =?UTF-8?q?n=C3=A1rios.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/funcionarioCard.dart | 88 +++++++++++++++++-- .../components/infoFuncionarios.dart | 75 ++++++++++++++++ .../dashboardAdmin/components/input.dart | 34 ++++--- 3 files changed, 178 insertions(+), 19 deletions(-) create mode 100644 catavento/lib/screens/dashboardAdmin/components/infoFuncionarios.dart diff --git a/catavento/lib/screens/dashboardAdmin/components/funcionarioCard.dart b/catavento/lib/screens/dashboardAdmin/components/funcionarioCard.dart index 4b14f0e..60c3677 100644 --- a/catavento/lib/screens/dashboardAdmin/components/funcionarioCard.dart +++ b/catavento/lib/screens/dashboardAdmin/components/funcionarioCard.dart @@ -1,27 +1,38 @@ +import 'package:catavento/screens/components/infoFuncionarios.dart'; +import 'package:catavento/screens/components/showDialog.dart'; import 'package:flutter/material.dart'; +import 'input.dart'; import 'confirmDialog.dart'; - -class FuncionarioCard extends StatelessWidget { +class FuncionarioCard extends StatefulWidget{ final String nomeFuncionario; final String status; final String setor; + const FuncionarioCard({ super.key, required this.nomeFuncionario, required this.setor, required this.status, - }); + }); + + @override + State createState() { + return FuncionarioCardState(); + } +} +class FuncionarioCardState extends State{ + @override Widget build(BuildContext context) { return Card( margin: EdgeInsets.symmetric(vertical: 8.0), child: ListTile( - title: Text(nomeFuncionario), + title: Text(widget.nomeFuncionario), subtitle: Text( - 'Setor: $setor\nStatus: $status'), + 'Setor: ${widget.setor}\nStatus: ${widget.status}'), trailing: Row( mainAxisSize: MainAxisSize.min, children: [ @@ -29,6 +40,25 @@ class FuncionarioCard extends StatelessWidget { icon: Icon(Icons.info), onPressed: () { //Lógica ao clicar + showDialog( + context: context, + builder: (BuildContext context) { + return Showdialog( + width: 463, + height: 402, + title: 'nomeFuncionario', //Inserir o nome do funcionario + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + + children: [ + Infofuncionarios(nome: "Fulano", email: "email", status: "Ativo", setor: "Montagem", demanda: "Hello Kitty") //Trocar para as informações do banco de dados + ] + ), + ); + }, + ); + }, ), // botão de Editar. @@ -36,6 +66,54 @@ class FuncionarioCard extends StatelessWidget { icon: Icon(Icons.edit), onPressed: () { // editar a demanda + showDialog( + context: context, + builder: (BuildContext context) { + return Showdialog( + width: 463, + height: 402, + title: 'Editar', + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + + children: [ + Inputs(text: "Nome:",), + SizedBox(height: MediaQuery.of(context).size.height * 0.02), + Inputs(text: "Setor:",), + SizedBox(height: MediaQuery.of(context).size.height * 0.02), + Inputs(text: "Email:",), + SizedBox(height: MediaQuery.of(context).size.height * 0.02), + Inputs(text: "Nome de usuário:",), + SizedBox(height: MediaQuery.of(context).size.height * 0.02), + Inputs(text: "Senha:",), + SizedBox(height: MediaQuery.of(context).size.height * 0.08), + + Positioned.fill( + child: Center( + child: ElevatedButton(onPressed: (){ + //Lógica do botão + Navigator.pop(context); + }, + style: ElevatedButton.styleFrom( + backgroundColor: Colors.green, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(22) + ) + ), + child: Text( + "Cadastrar", + style: TextStyle(color: Colors.white), + ) + + ) + ) + ) + ] + ), + ); + }, + ); }, ), diff --git a/catavento/lib/screens/dashboardAdmin/components/infoFuncionarios.dart b/catavento/lib/screens/dashboardAdmin/components/infoFuncionarios.dart new file mode 100644 index 0000000..fee010c --- /dev/null +++ b/catavento/lib/screens/dashboardAdmin/components/infoFuncionarios.dart @@ -0,0 +1,75 @@ +import 'package:flutter/material.dart'; + +class Infofuncionarios extends StatelessWidget{ + final String nome; + final String email; + final String status; + final String setor; + final String demanda; + + const Infofuncionarios({ + super.key, + required this.nome, + required this.email, + required this.status, + required this.setor, + required this.demanda, + }); + + @override + Widget build(BuildContext context) { + return Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + + children: [ + Info(texto: "Nome: ", info: nome), + SizedBox(height: MediaQuery.of(context).size.height * 0.05), + Info(texto: "Email: ", info: email), + SizedBox(height: MediaQuery.of(context).size.height * 0.05), + Info(texto: "Status: ", info: status), + SizedBox(height: MediaQuery.of(context).size.height * 0.05), + Info(texto: "Setor: ", info: setor), + SizedBox(height: MediaQuery.of(context).size.height * 0.05), + Info(texto: "Atividade em andamento: ", info: demanda), + + ], + ); + } +} + +class Info extends StatelessWidget { + final String texto; + final String info; + + Info({ + required this.texto, + required this.info + }); + + @override + Widget build(BuildContext context) { + return Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + + children: [ + Text( + texto, + style: TextStyle( + fontSize: 20, + color: Colors.black, + fontWeight: FontWeight.bold + ), + ), + Text( + info, + style: TextStyle( + fontSize: 20, + color: Colors.black, + ) + ) + ], + ); + } +} \ No newline at end of file diff --git a/catavento/lib/screens/dashboardAdmin/components/input.dart b/catavento/lib/screens/dashboardAdmin/components/input.dart index e5761e1..3ff4da8 100644 --- a/catavento/lib/screens/dashboardAdmin/components/input.dart +++ b/catavento/lib/screens/dashboardAdmin/components/input.dart @@ -2,11 +2,15 @@ import 'package:flutter/material.dart'; class Inputs extends StatefulWidget { final String text; - final String hint; + final String? hint; + final TextEditingController? controller; + final Function(String)? onChanged; Inputs({ required this.text, - required this.hint, + this.hint, + this.controller, + this.onChanged, }); @override @@ -38,19 +42,21 @@ class InputsState extends State{ child: SizedBox( height: 33, child: TextField( - decoration: InputDecoration( - hintStyle: TextStyle( - fontSize: 15, - color: Colors.grey + controller: widget.controller, + onChanged: widget.onChanged, + decoration: InputDecoration( + hintStyle: TextStyle( + fontSize: 15, + color: Colors.grey + ), + hintText: widget.hint?? '', + filled: true, + fillColor: Colors.white, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(10) + ), + contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10) ), - hintText: widget.hint, - filled: true, - fillColor: Colors.white, - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(10) - ), - contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10) - ), ), )