-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f8b3822
commit f190409
Showing
15 changed files
with
258 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version.json,1728152850417,c1bac6fe7ab58112f718045c20deb1a41dcf19a02e1020238244536dc09630db | ||
manifest.json,1728148290215,67da68067b8ef9736b01012f3e02ac0ffe18e854a173106067660c100bd028a7 | ||
main.dart.js,1728152746244,39e365cbeff6588ba11f731b39b97fa331896bdb2343f6f0db180e65ff3eeb4d | ||
index.html,1728152850342,6da82dc58c7cb08e9d162a5b55899c1988b5da7219b120a1bcabac9715c87f1a | ||
flutter_service_worker.js,1728152851620,745d91485ff3a7bb91fb49b25f4c34e27836fd9bca9216ef8cbde5ac1f7e1916 | ||
flutter_bootstrap.js,1728152850321,7eafde75445215b267b9f2a5441df057de193861ded038fa85768363a5fb813c | ||
flutter.js,1726052018000,bdfafe4aa16419c55e07170cdaf2d56664b5fdc0fa1648424c760308f944d79e | ||
favicon.png,1711641864000,c023e85c356b33452a71456926b38343b06e82352785091f9bc4debc68956529 | ||
icons/Icon-maskable-512.png,1727438901368,acb883dcd1c47b0c08d93b9f838459a0a14957b1f044f759310893e89557a5e1 | ||
icons/Icon-maskable-192.png,1727438901374,1c3ba0c948915ce01efa0bcb9c9b22dffc63f30df9ff6c3288531c5209a86908 | ||
icons/Icon-512.png,1711641864000,db4e589fa57af5d94440c1679ae7b9248d82ddd3002614cf473439d0728d868f | ||
icons/Icon-192.png,1711641864000,84c73fff6a50c2573b3a7d2e09b2d55c628db625c8ca61c632a0add7028d2926 | ||
canvaskit/skwasm.worker.js,1726052388000,c4b4bf79e49758d9b00d8a2b2af62a979d81b39de63d002f6c3594ba5bf5ec1d | ||
canvaskit/skwasm.wasm,1726052388000,05686833202a9678427941106855591f5b780b26e27818f2a0d6c1af9960edb0 | ||
canvaskit/skwasm.js.symbols,1726052388000,ad83528321bd031071beb3550339d01a52ac2ad1acbcd619772b6fded14be998 | ||
canvaskit/skwasm.js,1726052388000,76d591512f312d38b06612a78e1f9e3202c0b0c846e283de2f3d63b5702e485d | ||
canvaskit/canvaskit.wasm,1726052300000,af636e6f5af32b8b9e62b046816b3eca81b1b9999a67d80ae099c70b4b1e4dd9 | ||
canvaskit/canvaskit.js.symbols,1726052298000,5f87146e29704d54f88cdf0e189addbf3290e06398d50c7153f88818f6568c61 | ||
canvaskit/canvaskit.js,1726052300000,38aedc9a9048bdfbebd0ae4763a5af2ff4742e604be7b696a4853e8f1e970ca9 | ||
canvaskit/chromium/canvaskit.wasm,1726052322000,24d416b2e80cfd7dfc34f3ee638188bab54b0d715457855b8b9303e2e895d541 | ||
canvaskit/chromium/canvaskit.js.symbols,1726052320000,ef0ef5073c624f5b469e8d9e6ed3d396cc53278ccc8811254da69a1cb9cc9695 | ||
canvaskit/chromium/canvaskit.js,1726052322000,c1dfde8615b48e2da75dae236a80b2fec444ece6337809d0e69b0ee0acbf9efc | ||
assets/NOTICES,1728152850497,e2fb89d9e3c06e6fff8787ff981b24b14a470683a2c9e17a5f20a1603ee0b0d4 | ||
assets/FontManifest.json,1728152850496,0059f68c5df6acbe6f7c2fafc04f5538ef1c9dcb981103d7d174f3ea480baea1 | ||
assets/AssetManifest.json,1728152850496,36e074b6e48903e8e343f7d8a0b9e61d9569825ff8f1d91f4623d28b9d015c67 | ||
assets/AssetManifest.bin.json,1728152850496,c38971830625185f3782eb1f7932d9589bc2ffa0bf1d9c397fff6f7137524ea2 | ||
assets/AssetManifest.bin,1728152850496,b3ea7e0cb98ab8b876acb6c1b86b443771b7ab60115cd83a3c02ee086a7a9462 | ||
assets/shaders/ink_sparkle.frag,1728152850600,c1bf2e040de157dc910cb5f6d0106a2ffe939bbe1ee6beac13fe9ccc25f0db67 | ||
assets/fonts/MaterialIcons-Regular.otf,1728152851312,14e106167a63e32f4c0eebe8d25104abe6de0883ede3cca6dead0fd44ad6570c | ||
assets/assets/events.json,1728152406496,9fa3ae9353ab652383912b4540c4cdef51cc224edc5474acef39615af9a45450 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"events": [ | ||
{ | ||
"speaker": "Filipe Barroso", | ||
"title": "O que é Flutter?", | ||
"description": "Nesta apresentação vai ser feita uma introdução ao Flutter e como ele funciona. O que o distingue de outras tecnologias.", | ||
"time": "2024-10-12T10:00:00Z", | ||
"type_id":"1" | ||
}, | ||
{ | ||
"title": "Pausa", | ||
"description": "Pausa para um cafézinho", | ||
"time": "2024-10-12T10:45:00Z", | ||
"type_id":"0" | ||
}, | ||
{ | ||
"speaker": "Filipe Barroso", | ||
"title": "Flutter para Iniciantes", | ||
"description": "Nesta apresentação vai ser uma introdução ao Flutter para iniciantes. Com a apresentação dos Widgets mais comuns", | ||
"time": "2024-10-12T11:00:00Z", | ||
"type_id":"1" | ||
} , | ||
{ | ||
"speaker": "Mentores Flutter Portugal", | ||
"title": "Oficina de Instalação de Flutter", | ||
"description": "Será-te dado instruções como instalar o Flutter na tua máquina, com o apoio de um mentor.", | ||
"time": "2024-10-12T12:00:00Z", | ||
"type_id":"1" | ||
}, | ||
{ | ||
"title": "Almoço", | ||
"description": "Pausa para almoço", | ||
"time": "2024-10-12T13:00:00Z", | ||
"type_id":"0" | ||
}, | ||
{ | ||
"speaker": "Mentores Flutter Portugal", | ||
"title": "Oficina Individualizada & Contribuições Código Aberto a Fogos.pt", | ||
"description": "Nesta oficina terás a oportunidade de ter uma primeira experiência prática com Flutter, tanto poderás contribuir para um simples código base ou contribuir para o Fogos.pt", | ||
"time": "2024-10-12T14:00:00Z", | ||
"type_id":"1" | ||
}, | ||
{ | ||
"title": "Pausa", | ||
"description": "Pausa para um cafézinho", | ||
"time": "2024-10-12T10:45:00Z", | ||
"type_id":"0" | ||
}, | ||
{ | ||
"speaker": "Mentores Flutter Portugal", | ||
"title": "(Cont.) Oficina Individualizada & Contribuições Código Aberto a Fogos.pt", | ||
"description": "Nesta oficina terás a oportunidade de ter uma primeira experiência prática com Flutter, tanto poderás contribuir para um simples código base ou contribuir para o Fogos.pt", | ||
"time": "2024-10-12T14:00:00Z", | ||
"type_id":"1" | ||
}, | ||
{ | ||
"title": "Fim", | ||
"description": "Fim da Oficina", | ||
"time": "2024-10-12T17:45:00Z", | ||
"type_id":"0" | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"hosting": { | ||
"public": "web", | ||
"public": "build/web", | ||
"ignore": [ | ||
"firebase.json", | ||
"**/.*", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import 'package:dart_mappable/dart_mappable.dart'; | ||
import 'package:flutter_portugal_scheduler/features/agenda/domain/data.dart'; | ||
import 'package:flutter_portugal_scheduler/features/agenda/domain/agenda_base_value.dart'; | ||
|
||
part 'agenda_controller_state.mapper.dart'; | ||
|
||
@MappableClass() | ||
final class AgendaControllerState with AgendaControllerStateMappable { | ||
final Events? events; | ||
final List<AgendaBaseValue>? agenda; | ||
|
||
AgendaControllerState({required this.events}); | ||
AgendaControllerState({required this.agenda}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,36 @@ | ||
import 'package:flutter/services.dart'; | ||
import 'package:flutter_portugal_scheduler/features/agenda/domain/data.dart'; | ||
import 'package:flutter_portugal_scheduler/features/agenda/domain/agenda_base_value.dart'; | ||
import 'package:flutter_portugal_scheduler/features/agenda/domain/events.dart'; | ||
import 'package:intl/intl.dart'; | ||
|
||
class EventsRepository { | ||
Future<Events> loadEvents() async { | ||
class AgendaRepository { | ||
Future<List<AgendaBaseValue>> loadAgenda() async { | ||
final json = await _loadJson(); | ||
final events = EventsMapper.fromJson(json); | ||
return events; | ||
|
||
return events.events.map((event) { | ||
final dateFormat = DateFormat('HH:mm'); | ||
return switch (event.typeId) { | ||
0 => AgendaBreakValue( | ||
title: event.title, | ||
description: event.description, | ||
time: dateFormat.format(event.time), | ||
), | ||
1 => AgendaTalkValue( | ||
title: event.title, | ||
description: event.description, | ||
time: dateFormat.format(event.time), | ||
speaker: event.speaker, | ||
), | ||
_ => throw Exception('Invalid event type'), | ||
}; | ||
}).toList(); | ||
} | ||
} | ||
|
||
// New method to load JSON from a file | ||
Future<String> _loadJson() async { | ||
final String response = | ||
await rootBundle.loadString('assets/events.json'); // Load JSON file | ||
await rootBundle.loadString('assets/agenda.json'); // Load JSON file | ||
return response; // Decode JSON | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/// Base class for all events in the agenda | ||
sealed class AgendaBaseValue { | ||
final String title; | ||
final String description; | ||
final String time; | ||
|
||
AgendaBaseValue({ | ||
required this.title, | ||
required this.description, | ||
required this.time, | ||
}); | ||
} | ||
|
||
/// A break in the agenda | ||
class AgendaBreakValue extends AgendaBaseValue { | ||
AgendaBreakValue({ | ||
required super.title, | ||
required super.description, | ||
required super.time, | ||
}); | ||
} | ||
|
||
/// A talk in the agenda | ||
class AgendaTalkValue extends AgendaBaseValue { | ||
final String speaker; | ||
|
||
AgendaTalkValue({ | ||
String? speaker, | ||
required super.title, | ||
required super.description, | ||
required super.time, | ||
}) : assert(speaker != null, 'Speaker is required'), | ||
speaker = speaker ?? 'Unknown'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.