mbfakourii/full_picker

Instance member 'cancelCompression' can't be accessed using static access

Princeyyyy opened this issue · 2 comments

Hey, your package is wonderful and has been a great asset to my project. The issue is that the package refuses my project to run because of the above mentioned error:

Instance member 'cancelCompression' can't be accessed using static access

I've done research into your package and found that the issue is in the common_utils.dart file, specifically:

final PercentProgressDialog progressDialog = PercentProgressDialog(
  context,
  (final void value) {
    if (onProgress.value.toString() != '1.0') {
      LightCompressor.cancelCompression();
    }
  },
  onProgress,
  globalFullPickerLanguage.onCompressing,
);

I found the solution is to change the above to:

final LightCompressor compressor =
    LightCompressor(); // Create an instance of LightCompressor
final PercentProgressDialog progressDialog = PercentProgressDialog(
  context,
  (final void value) {
    if (onProgress.value.toString() != '1.0') {
      compressor.cancelCompression(); // Call the method on the instance
    }
  },
  onProgress,
  globalFullPickerLanguage.onCompressing,
);

I think you should include it in an update so that everyone can enjoy the package.

Thanks ❤️

Thanks for opening this issue.
This bug has been fixed.

Thank you