Did you know?
If your code checks the current platform with Platform.isIOS, you’ll get a runtime exception when you run on Flutter web. 💥
As an alternative, consider using the UniversalPlatform package, which works on all platforms and offers a unified syntax. 👍
ALT // 💥💥💥 will explode on web 💥💥💥
if (Platform.isIOS) {
// iOS logic here
}
// Better, but ugly
if (!kIsWeb && Platform.isIOS) {
// iOS logic here
}
// Cleaner and more robust
if (UniversalPlatform.isIOS) {
// iOS logic here
}