As dart has no different variable types for numbers (there are just num, int and double), the api gives you types.
So if you want a double for example in the output you have to insert
gson.encode(newDouble(1.0)); // >> 1.0d
Also the compiler gives these classes back to you, so you have to get the value property
gson.decode("1.0d").value; // >> 1.0
because booleans are displayed as bytes in gson, the boolean value is in the Byte type.
gson.encode(true) // >> 1b
gson.decode("1b").value // >> 1
gson.decode("1b").boolValue // >> true (and 0b will be false)
The program can't find the difference between the number 1 and true / the number 0 / false, because in the code it is the same.