setAlignment static method

Future<void> setAlignment(
  1. SunmiPrintAlign alignment
)

setAlignment

With this method you can align your text in three ways, like LEFT, RIGHT and CENTER.

Implementation

static Future<void> setAlignment(SunmiPrintAlign alignment) async {
  late int value;
  switch (alignment) {
    case SunmiPrintAlign.LEFT:
      value = 0;
      break;
    case SunmiPrintAlign.CENTER:
      value = 1;
      break;
    case SunmiPrintAlign.RIGHT:
      value = 2;
      break;
    default:
      value = 0;
  }
  Map<String, dynamic> arguments = <String, dynamic>{"alignment": value};
  await _channel.invokeMethod("SET_ALIGNMENT", arguments);
}