sampleImage static method
Implementation
static Future<File> sampleImage({
required File file,
int? preferredSize,
int? preferredWidth,
int? preferredHeight,
}) async {
assert(() {
if (preferredSize == null &&
(preferredWidth == null || preferredHeight == null)) {
throw ArgumentError(
'Preferred size or both width and height of a resampled image must be specified.');
}
return true;
}());
final String path = await _channel.invokeMethod('sampleImage', {
'path': file.path,
'maximumWidth': preferredSize ?? preferredWidth,
'maximumHeight': preferredSize ?? preferredHeight,
});
return File(path);
}