Be careful when using if-case with the same identifier in dart/flutter. There is a different behavior between dartjs and vm.
This is still the case in the latest stable #Flutter version, but it has been fixed in the dart sdk version used by the main branch of Flutter.