Skip to content

Commit ca56f02

Browse files
committed
books app
1 parent 2050049 commit ca56f02

13 files changed

+222
-23
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
# Parte 1 - Apresentação
6+
7+
<div class="video-container">
8+
<iframe width="560" height="315" src="https://www.youtube.com/embed/ihCvYP5cPy0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
9+
</div>
10+

docs/app1-rock-in-rio/parte-1-estrutura.md renamed to docs/app1-rock-in-rio/parte-2-estrutura.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
sidebar_position: 2
33
---
44

5-
# Parte 1 - Estrutura
5+
# Parte 2 - Estrutura
6+
7+
<div class="video-container">
8+
<iframe width="560" height="315" src="https://www.youtube.com/embed/dxKEuLdfmvg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
9+
</div>
610

711
Criando um MaterialApp;
812

@@ -16,9 +20,7 @@ Enquanto não implementamos o `body`, utilizamos o widget `Placeholder`
1620

1721
Criamos uma lista de `Atracao`, que será exibida ao usuário
1822

19-
<div class="video-container">
20-
<iframe width="560" height="315" src="https://www.youtube.com/embed/dxKEuLdfmvg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
21-
</div>
23+
2224

2325

2426
```dart

docs/app1-rock-in-rio/parte-2-tela-inicial.md renamed to docs/app1-rock-in-rio/parte-3-tela-inicial.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
sidebar_position: 3
33
---
44

5-
# Parte 2 - Tela inicial
5+
# Parte 3 - Tela inicial
6+
7+
<div class="video-container">
8+
<iframe width="560" height="315" src="https://www.youtube.com/embed/ozQlgsk0UXg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
9+
</div>
610

711
A principal parte desta mudança é exibir o ListTile.
812

@@ -17,6 +21,3 @@ body: ListView.builder(
1721
),
1822
```
1923

20-
<div class="video-container">
21-
<iframe width="560" height="315" src="https://www.youtube.com/embed/ozQlgsk0UXg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
22-
</div>

docs/app1-rock-in-rio/parte-3-favoritos.md renamed to docs/app1-rock-in-rio/parte-4-favoritos.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
sidebar_position: 4
33
---
44

5-
# Parte 3 - Favoritos
5+
# Parte 4 - Favoritos
6+
7+
<div class="video-container">
8+
<iframe width="560" height="315" src="https://www.youtube.com/embed/P2krR7V_NbA" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
9+
</div>
610

711
O ListTile agora está completo.
812

@@ -27,6 +31,3 @@ return ListTile(
2731
);
2832
```
2933

30-
<div class="video-container">
31-
<iframe width="560" height="315" src="https://www.youtube.com/embed/P2krR7V_NbA" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
32-
</div>

docs/app1-rock-in-rio/parte-4-navegacao.md renamed to docs/app1-rock-in-rio/parte-5-navegacao.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
sidebar_position: 5
33
---
44

5-
# Parte 4 - Navegação
5+
# Parte 5 - Navegação
6+
7+
<div class="video-container">
8+
<iframe width="560" height="315" src="https://www.youtube.com/embed/6h-fOx0wRQU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
9+
</div>
610

711
Precisamos de uma estrutura para armazenar as atrações que foram favoritadas pelo usuário.
812

@@ -38,6 +42,3 @@ return Scaffold(
3842

3943

4044

41-
<div class="video-container">
42-
<iframe width="560" height="315" src="https://www.youtube.com/embed/6h-fOx0wRQU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
43-
</div>

docs/app1-rock-in-rio/parte-5-final.md renamed to docs/app1-rock-in-rio/parte-6-final.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
sidebar_position: 6
33
---
44

5-
# Parte 5 - Final
5+
# Parte 6 - Final
6+
7+
<div class="video-container">
8+
<iframe width="560" height="315" src="https://www.youtube.com/embed/I61FkVKTxO4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
9+
</div>
610

711
Adicionado a navegação para `AtracaoPage`, utilizando a função `onTap` do `ListTile`.
812

@@ -21,6 +25,3 @@ return ListTile(
2125
);
2226
```
2327

24-
<div class="video-container">
25-
<iframe width="560" height="315" src="https://www.youtube.com/embed/I61FkVKTxO4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
26-
</div>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
# Parte 1 - Apresentação
6+
7+
<div class="video-container">
8+
<iframe width="560" height="315" src="https://www.youtube.com/embed/S-Hvw-4shm0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
9+
</div>
10+

docs/app2-books/estrutura.md renamed to docs/app2-books/parte-2-estrutura.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
sidebar_position: 2
33
---
44

5-
# Parte 1 - Estrutura
6-
Esta é base do Books. Nada de novo (por enquanto).
5+
# Parte 2 - Estrutura
76

7+
<div class="video-container">
8+
<iframe width="560" height="315" src="https://www.youtube.com/embed/_ERoNVUVGBo" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
9+
</div>
810

11+
Esta é base do Books. Nada de novo (por enquanto).
912

1013
```dart
1114
import 'package:flutter/material.dart';
@@ -56,4 +59,5 @@ class _HomePageState extends State<HomePage> {
5659
);
5760
}
5861
}
59-
```
62+
```
63+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
5+
# Parte 3 - Async / Await
6+
7+
<div class="video-container">
8+
<iframe width="560" height="315" src="https://www.youtube.com/embed/WQ-Qvzi_uVs" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
9+
</div>
10+
11+
## O que é async / await?
12+
13+
São palavras-chave que permitem que você escreva código assíncrono de forma mais simples e direta.
14+
15+
## Como funciona?
16+
17+
A execução de um método assíncrono é pausada até que o resultado seja retornado. O método assíncrono retorna um Future.
18+
19+
## Como usar?
20+
21+
Marcando um método como assíncrono, você pode usar a palavra-chave `await` para esperar o resultado de um Future.
22+
23+
## Exemplo
24+
25+
```dart
26+
Future<void> operacaoAssincrona() async {
27+
print('Início do evento assíncrono');
28+
await Future.delayed(Duration(seconds: 2));
29+
print('Fim do evento assíncrono');
30+
}
31+
```
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
5+
# Parte 4 - Consumindo API
6+
7+
<div class="video-container">
8+
<iframe width="560" height="315" src="https://www.youtube.com/embed/III-4wW8efg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
9+
</div>
10+
11+
O método abaixo é o responsável por consultar na API do Google Books, utilizando as palavras-chave `async` e `await`.
12+
13+
```dart
14+
void _buscarLivros() async {
15+
final url = Uri.https(
16+
'www.googleapis.com',
17+
'/books/v1/volumes',
18+
{'q': '{http}'},
19+
);
20+
final response = await http.get(url);
21+
22+
if (response.statusCode == 200) {
23+
final jsonResponse = convert.jsonDecode(response.body);
24+
final itemCount = jsonResponse['totalItems'];
25+
print('Number of books about HTTP: $itemCount.');
26+
} else {
27+
print('Request failed with status: ${response.statusCode}.');
28+
}
29+
}
30+
```
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
41+
42+
43+
44+
45+
46+
47+

0 commit comments

Comments
 (0)