Skip to content

Commit

Permalink
[FIX] Dashboard compilando
Browse files Browse the repository at this point in the history
  • Loading branch information
JAugustoM committed Dec 16, 2024
1 parent 93fcf9e commit a994450
Show file tree
Hide file tree
Showing 11 changed files with 551 additions and 1,595 deletions.
5 changes: 2 additions & 3 deletions catavento/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:catavento/constants.dart';
import 'package:catavento/screens/dashboardAdmin/dashboard_admin.dart';
import 'package:catavento/screens/Login/login.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';
import 'package:supabase_flutter/supabase_flutter.dart';
Expand All @@ -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(),
},
Expand All @@ -48,7 +47,7 @@ class LoadView extends StatelessWidget {
builder: (context, snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.done:
return const Login();
return const DashBoardAdmin();
default:
return const CircularProgressIndicator();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class QuadroGraficoState extends State<QuadroGrafico> {
Widget build(BuildContext context) {
final size = MediaQuery.of(context).size; // Tamanho da tela
return BlocBuilder<DemandaBloc, DemandaState>(
buildWhen: (previous, current) => current is! FilterState,
buildWhen: (previous, current) => current is! DemandaFilterState,
builder: (context, response) {
final metaData = response.metaData;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class SearchState extends State<Search> {
onEditingComplete: () {
context.read<DemandaBloc>().add(DemandaFilter(
// BACKEND
'nomeDemanda',
'nome_demanda',
_nomeDemanda.text,
)); // BACKEND
},
Expand Down
6 changes: 3 additions & 3 deletions catavento/lib/screens/DashboardAdmin/dashboard_admin.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:io';
import 'package:catavento/screens/DashboardAdmin/components/demandCard.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:flutter/services.dart';
Expand All @@ -19,7 +20,6 @@ import 'package:catavento/shared/widgets/inputs.dart';
import 'package:catavento/screens/DashboardAdmin/components/quadroPrioridade.dart';
import 'package:catavento/screens/DashboardAdmin/components/quadroGrafico.dart';
import 'package:catavento/screens/DashboardAdmin/components/search.dart';
import 'package:catavento/screens/DashboardAdmin/components/demandCard.dart';

class DashBoardAdmin extends StatelessWidget {
const DashBoardAdmin({super.key});
Expand Down Expand Up @@ -203,12 +203,12 @@ class ListDemandaState extends State<ListDemanda> {
final demanda = state.databaseResponse[index];
return DemandCard(
nomeDemanda:
demanda['nomeDemanda'] ?? 'Nome não disponível',
demanda['nome_demanda'] ?? 'Nome não disponível',
status: demanda['status'] ?? 'Status não disponível',
codigo: demanda['codigo'] ?? 'Sem código',
descricao: demanda['descricao'] ?? 'Sem descricao',
id: demanda['id'],
imagemUrl: demanda['imagemUrl'] ?? '',
imagemUrl: demanda['imagem_url'] ?? '',
order: index,
bloc: context.read<DemandaBloc>(), // BACKEND
);
Expand Down
31 changes: 13 additions & 18 deletions catavento/lib/screens/Login/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import 'package:flutter/material.dart';
import 'components/input_purple.dart';
import 'components/button_singIn.dart';


class Login extends StatefulWidget{
const Login ({super.key});
class Login extends StatefulWidget {
const Login({super.key});

@override
_LoginState createState()=> _LoginState();
_LoginState createState() => _LoginState();
}

class _LoginState extends State<Login> {
bool isLoading = false;
@override
Expand Down Expand Up @@ -51,7 +51,8 @@ class _LoginState extends State<Login> {
SizedBox(
height: 60,
),
Form(child: Column(
Form(
child: Column(
children: [
PurpleTextField(
label: "Digite o nome do seu usuário",
Expand All @@ -60,7 +61,9 @@ class _LoginState extends State<Login> {
color: Color(0xCCACACAC),
),
),
SizedBox(height: 20,),
SizedBox(
height: 20,
),
PurpleTextField(
label: "Digite a sua senha",
icon: Icon(
Expand All @@ -72,22 +75,20 @@ class _LoginState extends State<Login> {
)),
Row(
mainAxisAlignment: MainAxisAlignment.end,

children: [
Container(

margin: EdgeInsets.fromLTRB(0, 50, 20, 0),
child: ButtonSingIn(
title: Text("Entrar" , style: TextStyle(
color: Colors.white
),),
title: Text(
"Entrar",
style: TextStyle(color: Colors.white),
),
isLoading: isLoading,
icon: Icon(
Icons.keyboard_arrow_right_rounded,
color: Colors.white,
),
onPressed: () {

setState(() {
isLoading = !isLoading;
});
Expand All @@ -97,7 +98,6 @@ class _LoginState extends State<Login> {
],
)
//SizedBox(height: 35),

],
),
),
Expand All @@ -118,9 +118,4 @@ class _LoginState extends State<Login> {
),
);
}



}


15 changes: 4 additions & 11 deletions catavento/lib/screens/dashboardAdmin/components/blocks.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:ffi';

import 'package:flutter/material.dart';

class Blocks extends StatefulWidget {
Expand All @@ -26,7 +24,6 @@ class Blocks extends StatefulWidget {
}

class BlocksState extends State<Blocks> {

@override
Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
Expand All @@ -42,12 +39,10 @@ class BlocksState extends State<Blocks> {
height: blockHeight,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: widget.color,
borderRadius: BorderRadius.circular(widget.borderRadius)
),
color: widget.color,
borderRadius: BorderRadius.circular(widget.borderRadius)),
),

if (widget.title != null)
if (widget.title != null)
Positioned(
top: 10,
left: 0,
Expand All @@ -63,15 +58,13 @@ class BlocksState extends State<Blocks> {
),
),
),

Positioned.fill(
child: Align(
alignment: Alignment.center,
child: widget.child,
),
),

],
);
}
}
}
Loading

0 comments on commit a994450

Please sign in to comment.