printAndroid method

Future<void> printAndroid()

Implementation

Future<void> printAndroid() async {
  var scale = PrefService.getInt('scale') ?? 1;
  var comments = PrefService.getBool('comments') ?? false;
  var interpretations = PrefService.getBool('interpretations') ?? false;
  var highlight = PrefService.getBool('highlight') ?? false;
  try {
    final String? result = await printChannel.invokeMethod(
        action == Action.PRINT ? 'printNstTest' : "shareNstTest", {
      "test": test!.toJson(),
      "scale": '$scale',
      "comments": comments,
      "interpretations": interpretations,
      "highlight": highlight
    });
    debugPrint("result : '$result'.");
    setState(() {
      isLoadingPrint = false;
      isLoadingShare = false;
    });
  } on PlatformException catch (e) {
    debugPrint("print : '${e.message}'.");
  }
}