Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad state: A Dart object attempted to access a native peer, but the native peer has been collected (nullptr). This is usually the result of calling methods on a native-backed object when the native resources have already been disposed. #1062

Open
bojianyin opened this issue May 14, 2024 · 0 comments

Comments

@bojianyin
Copy link

bojianyin commented May 14, 2024

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Bad state: A Dart object attempted to access a native peer, but the native peer has been collected (nullptr). This is usually the result of calling methods on a native-backed object when the native resources have already been disposed.
E/flutter ( 7816): #0 StateError._throwNew (dart:core-patch/errors_patch.dart:135:5)
E/flutter ( 7816): #1 _NativeCanvas._drawImage (dart:ui/painting.dart)
E/flutter ( 7816): #2 _NativeCanvas.drawImage (dart:ui/painting.dart:6014:27)
E/flutter ( 7816): #3 SliderPainter._drawThumbNodes (package:lib_kit/widgets/slider/slider_painter.dart:73:12)
E/flutter ( 7816):

    SvgAssetLoader loader = SvgAssetLoader('images/svg/public_selected_square.svg',packageName: 'lib_resource');
    final PictureInfo pictureInfo = await vg.loadPicture(loader, null);
    // final PictureInfo pictureInfo = await vg.loadPicture(SvgStringLoader(rawSvg), null);
    ui.Image image = await pictureInfo.picture.toImage(20, 20);

    canvas.drawImage(image,Offset(0, 0),nodePaint);```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant