reprint method

  1. @override
Future<void> reprint({
  1. required StoneReprintPayload reprintPayload,
})
override

Implementation

@override
Future<void> reprint({required StoneReprintPayload reprintPayload}) async {
  try {
    final response = await methodChannel.invokeMethod<Map>('reprint', reprintPayload.toJson());

    if (response is Map) {
      if (response['code'] != StoneStatusDeeplink.SUCCESS.name) {
        throw StoneReprintException(message: response['message']);
      }
    } else {
      throw StoneReprintException(message: 'invalid response');
    }
  } on StoneReprintException catch (e) {
    throw StoneReprintException(message: e.message);
  } on PlatformException catch (e) {
    throw StoneReprintException(message: e.message ?? 'PlatformException');
  } catch (e) {
    throw StoneReprintException(message: "reprint Error: $e");
  }
}