launch method

  1. @override
Future<bool> launch({
  1. required PinAction action,
  2. String? data,
})
override

Implementation

@override
Future<bool> launch({required PinAction action, String? data}) {
  if (!Platform.isAndroid) {
    throw Exception("Unsupported platform. Only Android is supported");
  } else {
    AndroidIntent(
      action: action.type,
      package: Constants.ttpBundleId,
      flags: [Flag.FLAG_ACTIVITY_SINGLE_TOP],
      componentName: 'com.mypinpad.openmpos.terminal.RootActivity',
      arguments: {
        'data': data ?? '',
        'action': action.type,
      },
    ).launch();
  }
  return SynchronousFuture(true);
}