'How can i change only the changing value in flutter signalr?
I cannot setup the logic. I have three values. You know signalr only changing value comes. When i tried to change, every values change. Here is my code part=>
Text(a![0].name == 'PLC201.val'
? '${a![0].value}': checkValue(a![0], a![0].name!)),
Text(a![0].name == 'PLC202.val'
? '${a![0].value}': checkValue(a![0], a![0].name!)),
Text(a![0].name == 'PLC203.val'
? '${a![0].value}': checkValue(a![0], a![0].name!)),
...
checkValue(SignalRModel a, String name) {
var value;
if(name == 'PLC201.val'){
return value = a.value;
} else if(name == 'PLC202.val'){
return value = a.value;
} else {
return value = a.value;
}
}
...
SignalRModel {
String? name;
String? value;
String? customCode;
}
This is my output from signalr => [{"Name":"PLC201.val","Value":"32,69906","CustomCode":"EGS"}]
Where is the problem? Is anyone help me to solve this? I only update the changing value.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|