ifMobileApp static method

void ifMobileApp({
  1. void doThis()?,
  2. void otherwise()?,
})

ifMobileApp differentiate environemtna nad run logic based on platform

Implementation

static void ifMobileApp({
  void Function()? doThis,
  void Function()? otherwise,
}) {
  if (!kIsWeb) {
    doThis!();
  } else {
    otherwise!();
  }
}