Check out example codes for "flutter check ios or android". It will help you in understanding the concepts better.

Code Example 1

bool isIOS = Theme.of(context).platform == TargetPlatform.iOS;
bool isAndroid = Theme.of(context).platform == TargetPlatform.android;

Learn ReactJs, React Native from akashmittal.com