Imgkl / davinci

A flutter package to convert any widget to an Image.

Home Page:https://pub.dev/packages/davinci

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

XNORGATE opened this issue · comments

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.

Hey @XNORGATE

Thanks for using this package.

Can you share the error logs?