Dart Vérifiez si l'objet a une propriété
if (obj.containsKey('property')) {
// do something
}
VasteMonde
if (obj.containsKey('property')) {
// do something
}
void main(){
var a = 'Apple';
var b = 100;
var c = [1, 2, 3, 4, 5];
var d = {
"name": "John Doe",
"age" : 40
};
var e = 1.14;
print(a.runtimeType); // String
print(b.runtimeType); // int
print(c.runtimeType); // JSArray<int>
print(d.runtimeType); // JsLinkedHashMap<String, Object>
print(e.runtimeType); // double
}