181186 - Criar PDV Android para rodar em maquinas P.O.S.
This commit is contained in:
commit
c9983cbad5
204 files changed
+11453
No files matched your search
@@ -0,0 +1,15 @@
|
||||
class Department {
|
||||
const Department({required this.id, required this.name});
|
||||
|
||||
final int id;
|
||||
final String name;
|
||||
|
||||
factory Department.fromJson(Map<String, dynamic> json) {
|
||||
final id = json['id'];
|
||||
final name = json['name'];
|
||||
if (id is! num || name is! String) {
|
||||
throw const FormatException('Resposta de departamento inválida.');
|
||||
}
|
||||
return Department(id: id.toInt(), name: name);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user