isMobile function

bool isMobile({
  1. required bool supportWeb,
  2. TargetPlatform? platform,
  3. bool? overrideIsWeb,
})

supportWeb is a parameter that ask you if we should care about web support if the value is true then we will return the result no matter if we are on web or using a native app to run the flutter app

Implementation

bool isMobile({
  required bool supportWeb,
  TargetPlatform? platform,
  bool? overrideIsWeb,
}) {
  if (isWeb(overrideIsWeb: overrideIsWeb) && !supportWeb) return false;
  platform ??= defaultTargetPlatform;
  return {TargetPlatform.iOS, TargetPlatform.android}.contains(platform);
}