Imgkl / davinci

A flutter package to convert any widget to an Image.
https://pub.dev/packages/davinci
MIT License
47 stars 24 forks source link

DavinciCapture.offStage , Uint8List object returned null when built in physic device . #33

Open XNORGATE opened 12 months ago

XNORGATE commented 12 months ago

Unhandled Exception: type 'Null' is not a subtype of type 'Uint8List'

As the topic says, i got an error when running debug test in physic device(iphone XR , Ios 17) but it works properly on both iphone 15 and iphone XR simulator (ios 17)

my code

static Future<void> update(context, Widget widget) async {
    Uint8List bytes = await DavinciCapture.offStage(widget,
        context: context,
        returnImageUint8List: true,
        wait: const Duration(seconds: 1),
        openFilePreview: true);
    final directory = await getApplicationSupportDirectory();
    File tempFile =
        File("${directory.path}/${DateTime.now().toIso8601String()}.png");
    await tempFile.writeAsBytes(bytes);

screenshots

iphone 15 Simulator image

iphone XR Simulator image

iphone XR physic device image

Appreciated for developed this awesome pkg.

Imgkl commented 8 months ago

Hey @XNORGATE

Thanks for using this package.

Can you share the error logs?