killLastInstance method

Future<void> killLastInstance()

Implementation

Future<void> killLastInstance() async {
  // Get list of running processes
  final processes = await _listApp();

  // If the processes list is more than one one kill last pid from the list!
  if (processes.length > 1) {
    await killAppId(processes.lastOrNull?.pid);
  }
}