start static method

Future start(
  1. List<String> args,
  2. Widget child,
  3. String title
)

Implementation

static Future start(List<String> args, Widget child, String title) async {
  await PlatformGlobals.setGlobals();

  args = args.map((arg) => arg.toLowerCase()).toList();
  if (args.contains('--kiosk')) {
    PlatformGlobals.isKiosk = true;
    PlatformGlobals.isTv = true;
  }
  if (args.contains('--tv')) {
    PlatformGlobals.isTv = true;
  }

  var prefs = await SharedPreferences.getInstance();
  Preferences.prefs = prefs;

  if (PlatformGlobals.isKiosk) {
    SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
    if (Platform.isLinux) {
      try {
        await const MethodChannel('my_app/fullscreen')
            .invokeMapMethod('enableFullscreen');
      } on PlatformException catch (e) {
        log("Failed to enable fullscreen: '${e.message}'.");
      }
    }
  }

  runApp(
    OpenMediaStationApp(
      title: title,
      child: child,
    ),
  );
}