Skip to content

Commit

Permalink
Merge pull request #91 from disciplinas-prof-Edeilson-UFT/release_3.0.0
Browse files Browse the repository at this point in the history
Release 3.0.0
  • Loading branch information
LindomarRodrigues authored Dec 2, 2021
2 parents 0341668 + 5228bdd commit 2fc70aa
Show file tree
Hide file tree
Showing 24 changed files with 728 additions and 359 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

## Etapa de desenvolvimento

### Semana 2 - 11/11/2021 - 18/11/20213
### Semana 3 e 4 - 18/11/2021 - 02/12/2021

- [ ] R2 - Tela de pedidos
- [x] T5 - Resgatando dados do firestore do R2/T4 - Lindomar Rodrigues
- [ ] R4 - Firebase
- [x] Documentos cadastrados(estáticos) - Marcos Gilmário


### Semana 2 - 11/11/2021 - 18/11/2021

- [ ] R0 - Tela de início
- [x] T6 - state, model e action do R0/T1 - Pablo henrique
Expand Down
23 changes: 14 additions & 9 deletions lib/actions/banner_de_categoria_action.dart
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import 'package:ifood_engenharia_de_software/models/banner_de_categoria_model.dart';

class AlterarBannerDeCategoria {

final List<CategoriaBanner> listacategoria;

AlterarBannerDeCategoria(this.listacategoria);
AlterarBannerDeCategoria( this.listacategoria);

BannerDeCategoriaModel bannerdecategoriaData = const BannerDeCategoriaModel([
CategoriaBanner('Express'),
CategoriaBanner('Mercado'),
CategoriaBanner('Farmácia'),
CategoriaBanner('Bebidas'),
CategoriaBanner('Pizza'),
CategoriaBanner('Lanches')
]);
BannerDeCategoriaModel bannerdecategoriaData = const BannerDeCategoriaModel(
[ CategoriaBanner('Salgados','https://cdn.discordapp.com/attachments/814528592419094570/912145821808599060/salgados1.jpg'),
CategoriaBanner('Lanches','https://cdn.discordapp.com/attachments/814528592419094570/912145821292716062/lanches1.jpg'),
CategoriaBanner('Carnes','https://cdn.discordapp.com/attachments/814528592419094570/912145821049438238/carnes1.jpg'),
CategoriaBanner('Pizza','https://cdn.discordapp.com/attachments/814528592419094570/912145821565341736/pizza1.jpg'),
CategoriaBanner('Japonesa','https://cdn.discordapp.com/attachments/814528592419094570/912154611559858266/19C1-japonesa.png'),
CategoriaBanner('Açaí','https://cdn.discordapp.com/attachments/814528592419094570/912154798323793930/19C1-acai.png'),
CategoriaBanner('Bebidas','https://cdn.discordapp.com/attachments/814528592419094570/912191740105089054/19C1-bebidas.png'),
CategoriaBanner('Saudável','https://cdn.discordapp.com/attachments/814528592419094570/912191814440742992/19C1-saudavel-v2.png'),
CategoriaBanner('Brasileira','https://cdn.discordapp.com/attachments/814528592419094570/912191878458380308/19C1-brasileira-v2.png'),
CategoriaBanner('Cozinha Rápida','https://cdn.discordapp.com/attachments/814528592419094570/912191949136605184/19C1-comida-rapida.png')
]);
}
20 changes: 20 additions & 0 deletions lib/actions/card_mais_pedidos_por_vc_action.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import 'package:ifood_engenharia_de_software/models/mais_pedidos_por_vc_model.dart';

class AlterarMaisPedidos {
final List<MaisPedidos> maispedidoslist;

AlterarMaisPedidos(this.maispedidoslist);

MaisPedidosModel maispedidosData = const MaisPedidosModel([
MaisPedidos('Bar do Diluc', 'Fechado',
'https://cdn.discordapp.com/attachments/809775517493624852/910734117115674624/b3225dcdeebef9074c9c082afde8d495_2527226506439238336.png'),
MaisPedidos('Noelle´s Pancakes', '',
'https://cdn.discordapp.com/attachments/809775517493624852/910732173445832754/4ea27fde21b997bc3fb141786fc1719c_6363129461192613770.png'),
MaisPedidos('Escudo Inquebrável', 'Fechado',
'https://cdn.discordapp.com/attachments/809775517493624852/910740130833244160/show.png'),
MaisPedidos('Presente dos Reis', 'Fechado',
'https://media.discordapp.net/attachments/809775517493624852/910736507881553931/b891ddaf349a66bf1cdcccabec3c9a5b.png'),
MaisPedidos('Vikings', '',
'https://cdn.discordapp.com/attachments/809775517493624852/910736208626323497/22132_800x800.png')
]);
}
29 changes: 22 additions & 7 deletions lib/actions/peca_novamente_action.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:ifood_engenharia_de_software/models/peca_novamente_model.dart';

class AlterarPecaNovamente {
final String urlLogoRestaurante;
final List<Produto> pedidos;
import '../app_store.dart';

AlterarPecaNovamente(this.urlLogoRestaurante, this.pedidos);
class AtualizarPecaNovamente {
FirebaseFirestore firestore = FirebaseFirestore.instance;
final PecaNovamenteModel pecaNovamenteData;

PecaNovamenteModel pecaNovamenteData = const PecaNovamenteModel(
'https://aguardando.fase.de.utilizar.o.storage/',
[Produto('Pizza G Calabresa C/Borda Mista', 1)]);
AtualizarPecaNovamente({this.pecaNovamenteData = const PecaNovamenteModel()});

void atualizar() {
firestore
.collection('pecadenovo')
.doc('zVxxTLxTaNDSsy4LWmfH')
.get()
.then((DocumentSnapshot documento) {
String urlLogoRestaurante = documento['logo_estabelecimento_img_url'];
Produto produto = Produto(documento['produto'], documento['quantidade']);
PecaNovamenteModel pecaNovamenteData = PecaNovamenteModel(
urlLogoRestaurante: urlLogoRestaurante, pedidos: [produto]);

appStore.dispatcher(
AtualizarPecaNovamente(pecaNovamenteData: pecaNovamenteData));
});
}
}
16 changes: 16 additions & 0 deletions lib/actions/ultimas_lojas_action.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import 'package:ifood_engenharia_de_software/models/ultimas_lojas_model.dart';

class AlterarUltimasLojas {
final List<Lojas> listadaslojas;

AlterarUltimasLojas(this.listadaslojas);

UltimasLojasModel ultimaslojasData = const UltimasLojasModel(
[
Lojas("McDonald's",'https://i.imgur.com/L8VcJbD.png'),
Lojas('Burger King','https://i.imgur.com/BhBX8HH.png'),
Lojas('Giraffas','https://i.imgur.com/0I9W33L.png'),
Lojas('Subway','https://i.imgur.com/rYyDTK6.png'),
]
);
}
25 changes: 21 additions & 4 deletions lib/app_reducer.dart
Original file line number Diff line number Diff line change
@@ -1,25 +1,42 @@
import 'actions/banner_de_categoria_action.dart';
import 'actions/card_da_categoria_componente_action.dart';
import 'actions/card_mais_pedidos_por_vc_action.dart';
import 'actions/navegacao_rodape_action.dart';
import 'actions/peca_novamente_action.dart';
import 'actions/card_da_categoria_componente_action.dart';
import 'app_state.dart';
import 'actions/banner_de_categoria_action.dart';
import 'actions/ultimas_lojas_action.dart';

AppState reducer(AppState state, dynamic action) {
if (action is AlterarPagina) {
return AppState(paginaAtual: action.pagina);
} else if (action is AlterarPecaNovamente) {
if (action.pagina == 2) {
AtualizarPecaNovamente().atualizar();
}
return AppState(
paginaAtual: action.pagina, pecaNovamenteData: state.pecaNovamenteData);
} else if (action is AtualizarPecaNovamente) {
return AppState(
paginaAtual: state.paginaAtual,
pecaNovamenteData: action.pecaNovamenteData);
} else if (action is AlterarMaisPedidos) {
return AppState(
paginaAtual: state.paginaAtual,
maispedidosData: action.maispedidosData);
} else if (action is AlterarBannerDeCategoria) {
return AppState(
paginaAtual: state.paginaAtual,
bannerdecategoriaData: action.bannerdecategoriaData);
} else if (action is AlterarCard) {
return AppState(
paginaAtual: state.paginaAtual,
cardcategoriaData: action.cardcategoriaData);
} else {
cardcategoriaData:action.cardcategoriaData);
}else if (action is AlterarUltimasLojas) {
return AppState(
paginaAtual: state.paginaAtual,
ultimaslojasData:action.ultimaslojasData);
}else {

return AppState();
}
}
60 changes: 49 additions & 11 deletions lib/app_state.dart
Original file line number Diff line number Diff line change
@@ -1,29 +1,46 @@
import 'package:flutter/material.dart';
import 'package:ifood_engenharia_de_software/utilities/cores.dart';
import 'models/ultimas_lojas_model.dart';


import 'models/banner_de_categoria_model.dart';
import 'models/card_da_categoria_componente_model.dart';
import 'models/mais_pedidos_por_vc_model.dart';
import 'models/peca_novamente_model.dart';

class AppState {
final int paginaAtual;
final PecaNovamenteModel pecaNovamenteData;
final CategoriaModel cardcategoriaData;

final MaisPedidosModel maispedidosData;
final UltimasLojasModel ultimaslojasData;
final BannerDeCategoriaModel bannerdecategoriaData;

AppState(
{this.paginaAtual = 0,
this.pecaNovamenteData = const PecaNovamenteModel(
'https://aguardando.fase.de.utilizar.o.storage/',
[Produto('Pizza G Calabresa C/Borda Mista', 1)]),

this.pecaNovamenteData = const PecaNovamenteModel(),
this.bannerdecategoriaData = const BannerDeCategoriaModel([
CategoriaBanner('express'),
CategoriaBanner('Mercado'),
CategoriaBanner('Farmácia'),
CategoriaBanner('Bebidas'),
CategoriaBanner('Pizza'),
CategoriaBanner('Lanches')
CategoriaBanner('Salgados',
'https://cdn.discordapp.com/attachments/814528592419094570/912145821808599060/salgados1.jpg'),
CategoriaBanner('Lanches',
'https://cdn.discordapp.com/attachments/814528592419094570/912145821292716062/lanches1.jpg'),
CategoriaBanner('Carnes',
'https://cdn.discordapp.com/attachments/814528592419094570/912145821049438238/carnes1.jpg'),
CategoriaBanner('Pizza',
'https://cdn.discordapp.com/attachments/814528592419094570/912145821565341736/pizza1.jpg'),
CategoriaBanner('Japonesa',
'https://cdn.discordapp.com/attachments/814528592419094570/912154611559858266/19C1-japonesa.png'),
CategoriaBanner('Açaí',
'https://cdn.discordapp.com/attachments/814528592419094570/912154798323793930/19C1-acai.png'),
CategoriaBanner('Bebidas',
'https://cdn.discordapp.com/attachments/814528592419094570/912191740105089054/19C1-bebidas.png'),
CategoriaBanner('Saudável',
'https://cdn.discordapp.com/attachments/814528592419094570/912191814440742992/19C1-saudavel-v2.png'),
CategoriaBanner('Brasileira',
'https://cdn.discordapp.com/attachments/814528592419094570/912191878458380308/19C1-brasileira-v2.png'),
CategoriaBanner('Cozinha Rápida',
'https://cdn.discordapp.com/attachments/814528592419094570/912191949136605184/19C1-comida-rapida.png'),
]),
this.cardcategoriaData = const CategoriaModel([
Categoria('Pizza', AppCores.vermelhoPrincipal,
Expand All @@ -38,5 +55,26 @@ class AppState {
'https://cdn.discordapp.com/attachments/809775517493624852/910621467291570186/japones.jpg'),
Categoria('Doces', Color(0xffF8879B),
'https://cdn.discordapp.com/attachments/868118606448324638/910683119441547284/saudavel.jpg')
])});
]),
this.maispedidosData = const MaisPedidosModel([
MaisPedidos('Bar do Diluc', 'Fechado',
'https://cdn.discordapp.com/attachments/809775517493624852/910734117115674624/b3225dcdeebef9074c9c082afde8d495_2527226506439238336.png'),
MaisPedidos('Noelle´s Pancakes', '',
'https://cdn.discordapp.com/attachments/809775517493624852/910732173445832754/4ea27fde21b997bc3fb141786fc1719c_6363129461192613770.png'),
MaisPedidos('Escudo Inquebrável', 'Fechado',
'https://cdn.discordapp.com/attachments/809775517493624852/910740130833244160/show.png'),
MaisPedidos('Presente dos Reis', 'Fechado',
'https://media.discordapp.net/attachments/809775517493624852/910736507881553931/b891ddaf349a66bf1cdcccabec3c9a5b.png'),
MaisPedidos('Vikings', '',
'https://cdn.discordapp.com/attachments/809775517493624852/910736208626323497/22132_800x800.png')
]),
this.ultimaslojasData = const UltimasLojasModel(
[
Lojas("McDonald's",'https://i.imgur.com/L8VcJbD.png'),
Lojas('Burger King','https://i.imgur.com/BhBX8HH.png'),
Lojas('Giraffas','https://i.imgur.com/0I9W33L.png'),
Lojas('Subway','https://i.imgur.com/rYyDTK6.png'),
]),

});
}
71 changes: 53 additions & 18 deletions lib/components/busca/banner_de_categoria_componente.dart
Original file line number Diff line number Diff line change
@@ -1,39 +1,74 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:ifood_engenharia_de_software/models/banner_de_categoria_model.dart';
import 'package:ifood_engenharia_de_software/utilities/cores.dart';

class BannersDeCategorias extends StatelessWidget {
final List<CategoriaBanner> listacategoria;

const BannersDeCategorias({Key? key, required this.listacategoria})
: super(key: key);

@override
Widget build(BuildContext context) {
final ButtonStyle style = ElevatedButton.styleFrom(
textStyle: const TextStyle(fontSize: 15, fontWeight: FontWeight.bold),
fixedSize: const Size(175, 70),
primary: AppCores.vermelhoPrincipal);

return GridView.builder(
scrollDirection: Axis.vertical,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: (4 / 2),
crossAxisSpacing: 20,
mainAxisSpacing: 20),
crossAxisSpacing: 10,
mainAxisSpacing: 10),
shrinkWrap: true,
itemCount: listacategoria.length,
itemBuilder: (BuildContext context, index) {
return ElevatedButton(
style: style,
onPressed: () {},
child: Column(children: [
const SizedBox(height: 15),
Row(children: [
Text(listacategoria[index].nome),
])
]));
});
return Container(
height: 100,
width: 400,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
color: Colors.grey[100],
image: DecorationImage(
fit: BoxFit.fill,
image: NetworkImage(listacategoria[index].imgurl)
),
),

child:Padding(
padding: const EdgeInsets.all(5),
child:Text(listacategoria[index].nome,
style: const TextStyle(fontSize: 15, fontWeight: FontWeight.bold, color: Colors.white),)
)
);
}
);
}
}





























Loading

0 comments on commit 2fc70aa

Please sign in to comment.