generated from FGA0138-MDS-Ajax/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from FGA0138-MDS-Ajax/25-gerenciamento-funcion…
…arios 25 gerenciamento funcionarios
- Loading branch information
Showing
11 changed files
with
857 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
catavento/lib/screens/dashboardAdmin/components/ativAndamentoCard.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' | ||
), | ||
), | ||
); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
catavento/lib/screens/dashboardAdmin/components/background.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class BackgroundPage extends StatelessWidget { | ||
final Color? backgroundColor; | ||
final List<Color>? gradientColors; | ||
final List<Widget>children; | ||
|
||
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, | ||
) | ||
], | ||
); | ||
} | ||
} |
77 changes: 77 additions & 0 deletions
77
catavento/lib/screens/dashboardAdmin/components/blocks.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
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 Widget child; | ||
|
||
Blocks({ | ||
this.title, | ||
this.height, | ||
this.width, | ||
this.borderRadius = 16.0, | ||
required this.color, | ||
required this.child, | ||
}); | ||
|
||
@override | ||
State<Blocks> createState() { | ||
return BlocksState(); | ||
} | ||
} | ||
|
||
class BlocksState extends State<Blocks> { | ||
|
||
@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 Stack( | ||
children: [ | ||
Container( | ||
width: blockWidth, | ||
height: blockHeight, | ||
padding: EdgeInsets.all(8.0), | ||
decoration: BoxDecoration( | ||
color: widget.color, | ||
borderRadius: BorderRadius.circular(widget.borderRadius) | ||
), | ||
), | ||
|
||
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, | ||
), | ||
), | ||
|
||
], | ||
); | ||
} | ||
} |
144 changes: 144 additions & 0 deletions
144
catavento/lib/screens/dashboardAdmin/components/funcionarioCard.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
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 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<FuncionarioCard> createState() { | ||
return FuncionarioCardState(); | ||
} | ||
} | ||
|
||
class FuncionarioCardState extends State<FuncionarioCard>{ | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
|
||
return Card( | ||
margin: EdgeInsets.symmetric(vertical: 8.0), | ||
child: ListTile( | ||
title: Text(widget.nomeFuncionario), | ||
subtitle: Text( | ||
'Setor: ${widget.setor}\nStatus: ${widget.status}'), | ||
trailing: Row( | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
IconButton( | ||
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. | ||
IconButton( | ||
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), | ||
) | ||
|
||
) | ||
) | ||
) | ||
] | ||
), | ||
); | ||
}, | ||
); | ||
|
||
}, | ||
), | ||
// 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 | ||
}, | ||
); | ||
}, | ||
); | ||
}), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
73 changes: 73 additions & 0 deletions
73
catavento/lib/screens/dashboardAdmin/components/graficInfo.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
|
||
|
||
class Graficinfo<B extends BlocBase<S>, S> extends StatefulWidget { | ||
final double? size; | ||
final IconData icons; | ||
final Color colorIcons; | ||
final String info; | ||
final String dataKey; | ||
final BlocBuilderCondition<S> buildWhen; | ||
|
||
Graficinfo ({ | ||
this.size, | ||
required this.icons, | ||
required this.colorIcons, | ||
required this.info, | ||
required this.dataKey, | ||
required this.buildWhen, | ||
|
||
}); | ||
|
||
@override | ||
State<Graficinfo<B, S>> createState() { | ||
return GraficinfoState<B, S>(); | ||
} | ||
} | ||
|
||
class GraficinfoState<B extends BlocBase<S>, S> extends State<Graficinfo<B, S>> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return BlocBuilder<B, S>( | ||
buildWhen: widget.buildWhen, | ||
builder: (context, response) { | ||
final metaData = (response as dynamic).metaData; | ||
|
||
return Row( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
Icon( | ||
widget.icons, | ||
size: widget.size, | ||
color: widget.colorIcons, | ||
), | ||
SizedBox(width: 20), | ||
|
||
Center( // Adicionado Center para centralizar o conteúdo dentro do Column | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.center, // Centralizado horizontalmente | ||
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), | ||
), | ||
], | ||
), | ||
), | ||
] | ||
); | ||
} | ||
); | ||
} | ||
} |
Oops, something went wrong.