Step 1: Add the import statement import ‘package:flutter/foundation. dart’; to your file. The above code snippet checks if the current platform is Android or not. It first detects the current platform using defaultTargetPlatform and compares it with the values inside the TargetPlatform.
Read moreHow do you use third party API in Flutter?
It works on the below message-passing style:
Read moreWho supports Flutter?
Flutter maintains official support for the following IDEs and editors via plugins:
Read moreWhat are platforms supported by Flutter?
Flutter supports development using Linux, macOS, ChromeOS, and Windows .
Read more