wasStartedInBackground method

  1. @override
Future<bool> wasStartedInBackground()
override

Whether the app was started in the background by a media browser (Android Auto) through the shared engine, rather than by the user opening it. False where that can't happen.

Implementation

@override
Future<bool> wasStartedInBackground() async {
  if (defaultTargetPlatform != TargetPlatform.android) return false;
  return await methodChannel.invokeMethod<bool>('wasStartedInBackground') ??
      false;
}