onSecondInstance function

void onSecondInstance(
  1. dynamic cb(
    1. List<String>
    )
)

Attaches a callback to be run whenever a second instance of the app is executed. The arguments from that second instance will be passed into the callback.

onSecondInstance((List<String> args) => print("Arguments: $args"));

Implementation

void onSecondInstance(Function(List<String>) cb) {
  InstanceController.instance.callback = cb;
}