Created
August 21, 2019 20:54
-
-
Save fabiojansenbr/22a1e9ddc3c0fd46bd2d968d9aee43c9 to your computer and use it in GitHub Desktop.
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
// To parse this JSON data, do | |
// | |
// final modelo = modeloFromJson(jsonString); | |
import 'dart:convert'; | |
Modelo modeloFromJson(String str) => Modelo.fromJson(json.decode(str)); | |
String modeloToJson(Modelo data) => json.encode(data.toJson()); | |
class Modelo { | |
int modeloId; | |
String nomeModelo; | |
dynamic haste; | |
String cor; | |
String calibre; | |
dynamic shape; | |
double preco; | |
double precoTabela2; | |
double precoTabela3; | |
String ativo; | |
int idArmGrupo; | |
dynamic grife; | |
int grifeId; | |
Modelo({ | |
this.modeloId, | |
this.nomeModelo, | |
this.haste, | |
this.cor, | |
this.calibre, | |
this.shape, | |
this.preco, | |
this.precoTabela2, | |
this.precoTabela3, | |
this.ativo, | |
this.idArmGrupo, | |
this.grife, | |
this.grifeId, | |
}); | |
factory Modelo.fromJson(Map<String, dynamic> json) => new Modelo( | |
modeloId: json["modeloId"], | |
nomeModelo: json["nomeModelo"], | |
haste: json["haste"], | |
cor: json["cor"], | |
calibre: json["calibre"], | |
shape: json["shape"], | |
preco: json["preco"], | |
precoTabela2: json["precoTabela2"], | |
precoTabela3: json["precoTabela3"], | |
ativo: json["ativo"], | |
idArmGrupo: json["idArmGrupo"], | |
grife: json["grife"], | |
grifeId: json["grifeId"], | |
); | |
Map<String, dynamic> toJson() => { | |
"modeloId": modeloId, | |
"nomeModelo": nomeModelo, | |
"haste": haste, | |
"cor": cor, | |
"calibre": calibre, | |
"shape": shape, | |
"preco": preco, | |
"precoTabela2": precoTabela2, | |
"precoTabela3": precoTabela3, | |
"ativo": ativo, | |
"idArmGrupo": idArmGrupo, | |
"grife": grife, | |
"grifeId": grifeId, | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment