I narrowed down my question from Same dart code outputs different result on Web and Mobile to this single line of code
print(~(123 >> 1));
Why does this print -62 on Dart mobile and 4294967234 on Dart web
What is the workaround or correct solution to make the same code "multiplatform"
Edit
~ // what is this operator ? this is the route cause I guess
Solved . Replaced the ~ with
// This is equivalent to the bitwise NOT operator ~
// However, this outputs a wrong a value on web,
// so we do it manually
static int bitwiseNot(int x) {
return -x - 1;
}