fix a checked mode issues with preferences.dart

`preferences.dart` used a mixture of accepting / setting Strings and vars for the values of the prefs. I hit a checked mode exception because of this, when somebody tried to set and retrieve a bool. Changed all the values to accept dynamic/var; we can now persist any type that's legal for json.

@umop