Skip to content

Commit f66f7e0

Browse files
committed
Aula 02 - Home initial
1 parent a08a454 commit f66f7e0

File tree

6 files changed

+392
-18
lines changed

6 files changed

+392
-18
lines changed

delivery_api/database.json

+314-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,314 @@
1-
{"users":[{"id":2,"name":"Rodrigo Rahman","email":"[email protected]","password":"123123"}],"adm_users":[{"id":2,"name":"Rodrigo Rahman","email":"[email protected]","password":"123123"}],"payment-types":[{"id":1,"name":"Cartão de crédito","acronym":"CC","enabled":true},{"id":2,"name":"Cartão de débito","acronym":"CD","enabled":true},{"id":3,"name":"Vale Refeição","acronym":"VR","enabled":true},{"id":4,"name":"Vale Alimentação","acronym":"VA","enabled":true},{"id":5,"name":"teste","acronym":"teste","enabled":false}],"products":[{"id":1,"name":"X-Salada","description":"Lanche acompanha pão, hambúguer, mussarela, alface, tomate e maionese","price":20.22,"enabled":true,"image":"/storage/mclumygt_jrs_1682022574279.jpg"},{"id":2,"name":"X-Burger","description":"Lanche acompanha pão, hambúguer, mussarela e maionese","price":15,"enabled":true,"image":"/storage/ilalxxjc_jrs_1682022613641.jpg"},{"id":3,"name":"X-Churrasco","description":"Lanche acompanha pão francês, contra filé, alface, vinagrete, queijo e maionese","price":23.0,"enabled":true,"image":"/storage/papfpljy_jrs_1682022661076.jpg"},{"id":4,"name":"X-Egg","description":"Lanche acompanha pão, hamburguer, queijo, ovo, maionese, alface e tomate","price":15.0,"enabled":true,"image":"/storage/jvxuusyp_jrs_1682022693626.jpg"},{"id":5,"name":"X-Calabresa","description":"Lanche acompanha pão, calabresa, vinagrete, queijo e maionese","price":19.0,"enabled":true,"image":"/storage/dbfgpedr_jrs_1682022714065.jpg"},{"id":6,"name":"X-Bacon","description":"Lanche acompanha pão, hambúrguer, fatias de bacon, queijo, maionese, alface e tomate","price":19.0,"enabled":true,"image":"/storage/swltbvwc_jrs_1682022736008.jpg"},{"id":7,"name":"Porção de 500g Batata frita simples nova","description":"batata","price":20,"enabled":true,"image":"/storage/zblridqe_jrs_1682022754874.jpg"},{"id":8,"name":"Porção de 500g Calabresa acebolada","description":"","price":19.0,"enabled":true,"image":"/storage/igfbzmju_jrs_1682022776662.jpg"},{"id":9,"name":"Porção de 500g Batata com Cheddar e Bacon","description":"Batata Cheddar e Bacon","price":25.0,"enabled":true,"image":"/storage/jozzallr_jrs_1682022797344.jpg"},{"id":10,"name":"teste","description":"13212313","price":1231.23,"enabled":false,"image":"/storage/xdjjajvr_jrs_1682382186752.png"},{"id":11,"name":"teste","description":"32123","price":13.21,"image":"/storage/cmtirgjd_jrs_1682386884693.png","enabled":false}],"orders":[{"id":1,"date":"2023-04-25T00:00:00.000","status":"F","products":[{"id":1,"amount":2,"total_price":38.0},{"id":2,"amount":1,"total_price":19.0}],"user_id":2,"address":"Av Paulista, 51 São Paulo","CPF":1234156464,"payment_method_id":1},{"id":2,"date":"2023-04-25T00:00:00.000","status":"R","products":[{"id":1,"amount":2,"total_price":38.0},{"id":2,"amount":1,"total_price":19.0}],"user_id":2,"address":"Av Paulista, 51 São Paulo","CPF":1234156464,"payment_method_id":1},{"id":3,"date":"2023-04-25T00:00:00.000","status":"C","products":[{"id":1,"amount":2,"total_price":38.0},{"id":2,"amount":1,"total_price":19.0},{"id":3,"amount":2,"total_price":19.0}],"user_id":2,"address":"Av Paulista, 51 São Paulo","CPF":1234156464,"payment_method_id":1},{"id":4,"date":"2023-04-25T00:00:00.000","status":"R","products":[{"id":1,"amount":2,"total_price":38.0},{"id":2,"amount":1,"total_price":19.0},{"id":3,"amount":2,"total_price":19.0}],"user_id":2,"address":"Av Paulista, 51 São Paulo","CPF":1234156464,"payment_method_id":1},{"id":5,"date":"2023-04-25T00:00:00.000","status":"P","products":[{"id":1,"amount":2,"total_price":38.0},{"id":2,"amount":1,"total_price":19.0},{"id":3,"amount":2,"total_price":19.0}],"user_id":2,"address":"Av Paulista, 51 São Paulo","CPF":1234156464,"payment_method_id":1},{"id":6,"date":"2023-04-26T00:00:00.000","status":"R","products":[{"id":1,"amount":2,"total_price":38.0},{"id":2,"amount":1,"total_price":19.0},{"id":3,"amount":2,"total_price":19.0}],"user_id":2,"address":"Av Paulista, 51 São Paulo","CPF":1234156464,"payment_method_id":1},{"id":7,"date":"2023-04-26T00:00:00.000","status":"F","products":[{"id":1,"amount":2,"total_price":38.0},{"id":2,"amount":1,"total_price":19.0},{"id":3,"amount":2,"total_price":19.0}],"user_id":2,"address":"Av Paulista, 51 São Paulo","CPF":1234156464,"payment_method_id":1}]}
1+
{
2+
"users": [
3+
{
4+
"id": 2,
5+
"name": "Rodrigo Rahman",
6+
"email": "[email protected]",
7+
"password": "123123"
8+
}
9+
],
10+
"adm_users": [
11+
{
12+
"id": 2,
13+
"name": "Rodrigo Rahman",
14+
"email": "[email protected]",
15+
"password": "123123"
16+
}
17+
],
18+
"payment-types": [
19+
{
20+
"id": 1,
21+
"name": "Cartão de crédito",
22+
"acronym": "CC",
23+
"enabled": true
24+
},
25+
{
26+
"id": 2,
27+
"name": "Cartão de débito",
28+
"acronym": "CD",
29+
"enabled": true
30+
},
31+
{
32+
"id": 3,
33+
"name": "Vale Refeição",
34+
"acronym": "VR",
35+
"enabled": true
36+
},
37+
{
38+
"id": 4,
39+
"name": "Vale Alimentação",
40+
"acronym": "VA",
41+
"enabled": true
42+
},
43+
{
44+
"id": 5,
45+
"name": "teste",
46+
"acronym": "teste",
47+
"enabled": false
48+
}
49+
],
50+
"products": [
51+
{
52+
"id": 1,
53+
"name": "X-Salada",
54+
"description": "Lanche acompanha pão, hambúguer, mussarela, alface, tomate e maionese",
55+
"price": 20.22,
56+
"enabled": true,
57+
"image": "/storage/mclumygt_jrs_1682022574279.jpg"
58+
},
59+
{
60+
"id": 2,
61+
"name": "X-Burger",
62+
"description": "Lanche acompanha pão, hambúguer, mussarela e maionese",
63+
"price": 15,
64+
"enabled": true,
65+
"image": "/storage/ilalxxjc_jrs_1682022613641.jpg"
66+
},
67+
{
68+
"id": 3,
69+
"name": "X-Churrasco",
70+
"description": "Lanche acompanha pão francês, contra filé, alface, vinagrete, queijo e maionese",
71+
"price": 23.0,
72+
"enabled": true,
73+
"image": "/storage/papfpljy_jrs_1682022661076.jpg"
74+
},
75+
{
76+
"id": 4,
77+
"name": "X-Egg",
78+
"description": "Lanche acompanha pão, hamburguer, queijo, ovo, maionese, alface e tomate",
79+
"price": 15.0,
80+
"enabled": true,
81+
"image": "/storage/jvxuusyp_jrs_1682022693626.jpg"
82+
},
83+
{
84+
"id": 5,
85+
"name": "X-Calabresa",
86+
"description": "Lanche acompanha pão, calabresa, vinagrete, queijo e maionese",
87+
"price": 19.0,
88+
"enabled": true,
89+
"image": "/storage/dbfgpedr_jrs_1682022714065.jpg"
90+
},
91+
{
92+
"id": 6,
93+
"name": "X-Bacon",
94+
"description": "Lanche acompanha pão, hambúrguer, fatias de bacon, queijo, maionese, alface e tomate",
95+
"price": 19.0,
96+
"enabled": true,
97+
"image": "/storage/swltbvwc_jrs_1682022736008.jpg"
98+
},
99+
{
100+
"id": 7,
101+
"name": "Porção de 500g Batata frita simples nova",
102+
"description": "batata",
103+
"price": 20,
104+
"enabled": true,
105+
"image": "/storage/zblridqe_jrs_1682022754874.jpg"
106+
},
107+
{
108+
"id": 8,
109+
"name": "Porção de 500g Calabresa acebolada",
110+
"description": "",
111+
"price": 19.0,
112+
"enabled": true,
113+
"image": "/storage/igfbzmju_jrs_1682022776662.jpg"
114+
},
115+
{
116+
"id": 9,
117+
"name": "Porção de 500g Batata com Cheddar e Bacon",
118+
"description": "Batata Cheddar e Bacon",
119+
"price": 25.0,
120+
"enabled": true,
121+
"image": "/storage/jozzallr_jrs_1682022797344.jpg"
122+
},
123+
{
124+
"id": 10,
125+
"name": "teste",
126+
"description": "13212313",
127+
"price": 1231.23,
128+
"enabled": false,
129+
"image": "/storage/xdjjajvr_jrs_1682382186752.png"
130+
},
131+
{
132+
"id": 11,
133+
"name": "teste",
134+
"description": "32123",
135+
"price": 13.21,
136+
"image": "/storage/cmtirgjd_jrs_1682386884693.png",
137+
"enabled": false
138+
}
139+
],
140+
"orders": [
141+
{
142+
"id": 1,
143+
"date": "2023-04-25T00:00:00.000",
144+
"status": "F",
145+
"products": [
146+
{
147+
"id": 1,
148+
"amount": 2,
149+
"total_price": 38.0
150+
},
151+
{
152+
"id": 2,
153+
"amount": 1,
154+
"total_price": 19.0
155+
}
156+
],
157+
"user_id": 2,
158+
"address": "Av Paulista, 51 São Paulo",
159+
"CPF": 1234156464,
160+
"payment_method_id": 1
161+
},
162+
{
163+
"id": 2,
164+
"date": "2023-04-25T00:00:00.000",
165+
"status": "R",
166+
"products": [
167+
{
168+
"id": 1,
169+
"amount": 2,
170+
"total_price": 38.0
171+
},
172+
{
173+
"id": 2,
174+
"amount": 1,
175+
"total_price": 19.0
176+
}
177+
],
178+
"user_id": 2,
179+
"address": "Av Paulista, 51 São Paulo",
180+
"CPF": 1234156464,
181+
"payment_method_id": 1
182+
},
183+
{
184+
"id": 3,
185+
"date": "2023-04-25T00:00:00.000",
186+
"status": "C",
187+
"products": [
188+
{
189+
"id": 1,
190+
"amount": 2,
191+
"total_price": 38.0
192+
},
193+
{
194+
"id": 2,
195+
"amount": 1,
196+
"total_price": 19.0
197+
},
198+
{
199+
"id": 3,
200+
"amount": 2,
201+
"total_price": 19.0
202+
}
203+
],
204+
"user_id": 2,
205+
"address": "Av Paulista, 51 São Paulo",
206+
"CPF": 1234156464,
207+
"payment_method_id": 1
208+
},
209+
{
210+
"id": 4,
211+
"date": "2023-04-25T00:00:00.000",
212+
"status": "R",
213+
"products": [
214+
{
215+
"id": 1,
216+
"amount": 2,
217+
"total_price": 38.0
218+
},
219+
{
220+
"id": 2,
221+
"amount": 1,
222+
"total_price": 19.0
223+
},
224+
{
225+
"id": 3,
226+
"amount": 2,
227+
"total_price": 19.0
228+
}
229+
],
230+
"user_id": 2,
231+
"address": "Av Paulista, 51 São Paulo",
232+
"CPF": 1234156464,
233+
"payment_method_id": 1
234+
},
235+
{
236+
"id": 5,
237+
"date": "2023-04-25T00:00:00.000",
238+
"status": "P",
239+
"products": [
240+
{
241+
"id": 1,
242+
"amount": 2,
243+
"total_price": 38.0
244+
},
245+
{
246+
"id": 2,
247+
"amount": 1,
248+
"total_price": 19.0
249+
},
250+
{
251+
"id": 3,
252+
"amount": 2,
253+
"total_price": 19.0
254+
}
255+
],
256+
"user_id": 2,
257+
"address": "Av Paulista, 51 São Paulo",
258+
"CPF": 1234156464,
259+
"payment_method_id": 1
260+
},
261+
{
262+
"id": 6,
263+
"date": "2023-04-26T00:00:00.000",
264+
"status": "R",
265+
"products": [
266+
{
267+
"id": 1,
268+
"amount": 2,
269+
"total_price": 38.0
270+
},
271+
{
272+
"id": 2,
273+
"amount": 1,
274+
"total_price": 19.0
275+
},
276+
{
277+
"id": 3,
278+
"amount": 2,
279+
"total_price": 19.0
280+
}
281+
],
282+
"user_id": 2,
283+
"address": "Av Paulista, 51 São Paulo",
284+
"CPF": 1234156464,
285+
"payment_method_id": 1
286+
},
287+
{
288+
"id": 7,
289+
"date": "2023-04-26T00:00:00.000",
290+
"status": "F",
291+
"products": [
292+
{
293+
"id": 1,
294+
"amount": 2,
295+
"total_price": 38.0
296+
},
297+
{
298+
"id": 2,
299+
"amount": 1,
300+
"total_price": 19.0
301+
},
302+
{
303+
"id": 3,
304+
"amount": 2,
305+
"total_price": 19.0
306+
}
307+
],
308+
"user_id": 2,
309+
"address": "Av Paulista, 51 São Paulo",
310+
"CPF": 1234156464,
311+
"payment_method_id": 1
312+
}
313+
]
314+
}

lib/src/app_module.dart

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import 'package:flutter_modular/flutter_modular.dart';
2+
23
import './modules/home/home_page.dart';
34
import 'modules/core/core_module.dart';
4-
import 'modules/login/login_page.dart';
5+
import 'modules/login/login_module.dart';
56

67
class AppModule extends Module {
78
@override
@@ -11,7 +12,7 @@ class AppModule extends Module {
1112

1213
@override
1314
List<ModularRoute> get routes => [
14-
ChildRoute('/login', child: (context, args) => const LoginPage()),
15+
ModuleRoute('/login', module: LoginModule()),
1516
ChildRoute('/', child: (context, args) => const HomePage()),
1617
];
1718
}

lib/src/modules/home/home_page.dart

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
33
import '../../core/env/env.dart';
44
import '../../core/ui/helpers/loader.dart';
55
import '../../core/ui/helpers/messages.dart';
6+
import '../template/base_layout.dart';
67

78
class HomePage extends StatefulWidget {
89
const HomePage({super.key});
@@ -14,10 +15,7 @@ class HomePage extends StatefulWidget {
1415
class _HomePageState extends State<HomePage> with Loader, Messages {
1516
@override
1617
Widget build(BuildContext context) {
17-
return Scaffold(
18-
appBar: AppBar(
19-
title: const Text('Home Page'),
20-
),
18+
return BaseLayout(
2119
body: Container(
2220
child: Text(Env.instance.get('backend_base_url')),
2321
),

0 commit comments

Comments
 (0)