For UI that should differ slightly on iOS and Android, i.e. on different platforms, there must be a way to detect which one the app is running on, but I couldn't find it in the docs. What is it?
Flutter – How to detect the host platform from Dart code
dartflutter
Related Topic
- Flutter – Show/hide widgets in Flutter programmatically
- Flutter – Dart SDK is not configured
- Android – How to change the app display name build with Flutter
- Android – Flutter: upgrade the version code for play store
- Flutter – How to import platform specific dependency in Flutter/Dart? (Combine Web with Android/iOS)
Best Answer
All options include:
You can also detect if you are running on the web using
kIsWeb
, a global constant indicating if the application was compiled to run on the web:Platform
documentation: https://docs.flutter.io/flutter/dart-io/Platform-class.htmlkIsWeb
documentation: https://api.flutter.dev/flutter/foundation/kIsWeb-constant.html