-
Notifications
You must be signed in to change notification settings - Fork 0
/
Alarmes.swift
72 lines (59 loc) · 1.9 KB
/
Alarmes.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//
// Alarmes.swift
// MyDoctor
//
// Created by Turma01-3 on 08/10/24.
//
import SwiftUI
struct AlarmeCard: View {
var remedio: Remedio
var body: some View {
HStack(alignment: .top, spacing: 13){
VStack(alignment: .leading, spacing: 5){
Text(remedio.hora).font(/*@START_MENU_TOKEN@*/.title/*@END_MENU_TOKEN@*/).bold().foregroundColor(.cutielight)
HStack{
Text("\(String(remedio.quantidade) ) \(String(remedio.unidade) ) ").font(.headline).foregroundColor(.grumpy)
}
}
Spacer()
VStack(alignment: .leading, spacing: 5 ){
HStack{
Text(remedio.nome).font(.headline).bold().foregroundColor(.grumpy)
/*Text("\(String(remedio.estoque) ) \(String(remedio.unidade) ) ").font(.headline)*/
}
Text(remedio.detalhe).font(.headline).foregroundColor(.gray)
}
}.padding(.horizontal,22).frame(minWidth: 350,minHeight: 110).overlay(
RoundedRectangle(cornerRadius: 15)
.stroke(Color.cutielight, lineWidth: 3)
)
}
}
// Lista de Alarmes
struct AlarmeList: View {
@State var remedios: [Remedio] = carregarRemedios()
var body: some View {
Text("Informações do Remédio").bold().font(.title).foregroundColor(.gray)
VStack {
ForEach(remedios) { remedio in
AlarmeCard(remedio: remedio)
.padding(.bottom, 5)
}
}.onAppear{
remedios = carregarRemedios()
}
}
}
// Tela principal dos Alarmes
struct Alarmes: View {
var body: some View {
ScrollView {
AlarmeList()
}
.padding(.top,40 )
.padding()
}
}
#Preview {
Alarmes()
}