Skip to content

Commit

Permalink
Criação da janela para exibição das informações dos funcionários.
Browse files Browse the repository at this point in the history
  • Loading branch information
Leticia-Arisa-K-Higa authored and JAugustoM committed Dec 16, 2024
1 parent 3cca593 commit 3266093
Show file tree
Hide file tree
Showing 3 changed files with 178 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,41 +1,119 @@
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<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(nomeFuncionario),
title: Text(widget.nomeFuncionario),
subtitle: Text(
'Setor: $setor\nStatus: $status'),
'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),
)

)
)
)
]
),
);
},
);

},
),
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
)
)
],
);
}
}
34 changes: 20 additions & 14 deletions catavento/lib/screens/dashboardAdmin/components/input.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -38,19 +42,21 @@ class InputsState extends State<Inputs>{
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)
),
),
)

Expand Down

0 comments on commit 3266093

Please sign in to comment.