onTakeLocalSnapshotResult method
void
onTakeLocalSnapshotResult()
Implementation
void onTakeLocalSnapshotResult(
dynamic taskId,
int width,
int height,
String filePath,
int error,
) {
var completer = _localCompleters.remove(taskId.toString());
debugPrint(_localCompleters.toString());
if (completer == null) {
debugPrint('Completer<LocalSnapshot> not found!');
return;
}
if (completer.isCompleted || completer.isCanceled) {
debugPrint('Completer<LocalSnapshot> is consumed!');
return;
}
if (error == 0) {
completer.complete(
LocalSnapshot(
taskId: int.tryParse(taskId.toString()) ?? 0,
filePath: filePath,
width: width,
height: height,
),
);
} else {
completer.completeError(error);
}
}