contentToImage static method

Future<Uint8List> contentToImage({
  1. required String content,
  2. double duration = 0,
})

Implementation

static Future<Uint8List> contentToImage({
  required String content,
  double duration = 0,
}) async {
  final Map<String, dynamic> arguments = <String, dynamic>{
    'content': content,
    'duration': Platform.isIOS ? 2000 : duration,
  };
  Uint8List results = Uint8List.fromList(<int>[]);
  try {
    results = await _channel.invokeMethod('contentToImage', arguments) ??
        Uint8List.fromList(<int>[]);
  } on Exception catch (e) {
    log('[method:contentToImage]: $e');
    throw Exception('Error: $e');
  }
  return results;
}