I have an object in javascript code like this. I need to do this object in flutter. How can I do same thing in flutter with below javascript code ?
var object = {
tsSubCmds: [
{
entityType: "DEVICE",
entityId: entityId,
scope: "LATEST_TELEMETRY",
cmdId: 10
}
],
historyCmds: [],
attrSubCmds: [],
entityDataCmds: []
};
var data = JSON.stringify(object);
I tried to do like this. but it did not work like this.
var data = '{ tsSubCmds: [{entityType: DEVICE, entityId: ' + dashboardId + ', scope: LATEST_TELEMETRY, cmdId: 10 }], historyCmds: [], attrSubCmds: [], entityDataCmds: []}';
data = jsonDecode(data);
var object = jsonEncode(data);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…