convertToImage method

  1. @override
Future<Uint8List> convertToImage({
  1. required String content,
  2. Duration delay = const Duration(milliseconds: 200),
  3. int? width,
})
override

Implementation

@override
Future<Uint8List> convertToImage({
  required String content,
  Duration delay = const Duration(milliseconds: 200),
  int? width,
}) async {
  final Map<String, dynamic> arguments = {
    'content': content,
    'delay': delay.inMilliseconds,
    'width': width,
  };
  try {
    final result = await (methodChannel.invokeMethod(
        'convertToImage', arguments)) as Uint8List;
    return result;
  } on Exception catch (e) {
    throw Exception("Error: $e");
  }
}