printText method

  1. @override
Future<Map<String, dynamic>> printText(
  1. String text, {
  2. int fontSize = 50,
  3. bool isBold = false,
  4. bool isUnderline = false,
  5. String alignment = "LEFT",
})
override

text - Text to print (required) fontSize - Font size (default: 24) isBold - Make text bold (default: false) isUnderline - Underline text (default: false) alignment - Text alignment: "LEFT", "CENTER", "RIGHT" (default: "LEFT")

Implementation

/// [fontSize] - Font size (default: 24)
  /// [isBold] - Make text bold (default: false)
  /// [isUnderline] - Underline text (default: false)
  /// [alignment] - Text alignment: "LEFT", "CENTER", "RIGHT" (default: "LEFT")
  ///
 @override
  Future<Map<String, dynamic>> printText(
 String text, {
 int fontSize = 50,
 bool isBold = false,
 bool isUnderline = false,
 String alignment = "LEFT",
  }) async {
 try {
   final Map<String, dynamic> result = Map<String, dynamic>.from(
     await channel.invokeMethod('printText', {
       'text': text,
       'fontSize': fontSize,
       'isBold': isBold,
       'isUnderline': isUnderline,
       'alignment': alignment,
     })
   );
   return result;
 } on PlatformException catch (e) {
   throw SmartPosException('Failed to print text: ${e.message}');
 }
  }