-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from ES2-UFPI/iury
- Loading branch information
Showing
25 changed files
with
724 additions
and
157 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import 'package:intl/intl.dart'; | ||
|
||
class PlanoAlimentar { | ||
final String? id; | ||
final String consulta; | ||
final DateTime dtInicio; | ||
final DateTime dtFim; | ||
final List<String> refeicoes; | ||
final String paciente; | ||
final String nutricionista; | ||
|
||
PlanoAlimentar({ | ||
this.id, | ||
required this.consulta, | ||
required this.dtInicio, | ||
required this.dtFim, | ||
required this.refeicoes, | ||
required this.paciente, | ||
required this.nutricionista, | ||
}); | ||
|
||
factory PlanoAlimentar.fromJson(Map<String, dynamic> json) { | ||
return PlanoAlimentar( | ||
id: json['id'] ?? '', | ||
consulta: json['consulta'] ?? '', | ||
dtInicio: DateFormat('dd/MM/yyyy').parse(json['dt_inicio'] ?? ''), | ||
dtFim: DateFormat('dd/MM/yyyy').parse(json['dt_fim'] ?? ''), | ||
refeicoes: List<String>.from(json['refeicoes'] ?? []), | ||
paciente: json['id_paciente'] ?? '', | ||
nutricionista: json['id_nutricionista'] ?? '', | ||
); | ||
} | ||
|
||
Map<String, dynamic> toJson() { | ||
return { | ||
'id': id, | ||
'consulta': consulta, | ||
'dt_inicio': DateFormat('dd/MM/yyyy').format(dtInicio), | ||
'dt_fim': DateFormat('dd/MM/yyyy').format(dtFim), | ||
'refeicoes': refeicoes, | ||
'id_paciente': paciente, | ||
'id_nutricionista': nutricionista, | ||
}; | ||
} | ||
} |
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,31 @@ | ||
class Refeicao { | ||
final String? id; | ||
String nome; | ||
String observacoes; | ||
Map<String, String> alimentos; | ||
|
||
Refeicao({ | ||
this.id, | ||
required this.nome, | ||
required this.observacoes, | ||
required this.alimentos, | ||
}); | ||
|
||
factory Refeicao.fromJson(Map<String, dynamic> json) { | ||
return Refeicao( | ||
id: json['id'] ?? '', | ||
nome: json['nome'] ?? '', | ||
observacoes: json['observacoes'] ?? '', | ||
alimentos: Map<String, String>.from(json['alimentos'] ?? {}), | ||
); | ||
} | ||
|
||
Map<String, dynamic> toJson() { | ||
return { | ||
'id': id, | ||
'nome': nome, | ||
'observacoes': observacoes, | ||
'alimentos': alimentos, | ||
}; | ||
} | ||
} |
Oops, something went wrong.