bluefireteam / photo_view

📸 Easy to use yet very customizable zoomable image widget for Flutter, Photo View provides a gesture sensitive zoomable widget. Photo View is largely used to show interacive images and other stuff such as SVG.
MIT License
1.91k stars 548 forks source link

[BUG] AssertionError_throwNew when first launch the PhotoView; #406

Open inloop-tech opened 3 years ago

inloop-tech commented 3 years ago

Describe the bug I have created a screen with only photo_view widget. When first open that screen, my visual studio code will stop and pointed the error_patch.dart line 46 native "AssertionError_throwNew"; When I click the button to continue to execute the code. The next times open the screen seems it can normally display. However, open and close the same screen serval time, it shows a memory leak in my vs code debug code.

To Reproduce

  1. Create a screen with CarouselSlider.
  2. Click the CarouselSlider to open a screen to display photo using photo_view widget
  3. Start debug to execute the code
  4. Click on the CarouselSlider
  5. Stop and and pointed the error_patch.dart line 46 native "AssertionError_throwNew";
  6. Continue execute the code
  7. Open and close the screen with photo_view widget
  8. Sometime throw a memory leak error

What is the current behavior? Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.0.3, on macOS 11.0.1 20B50 darwin-x64, locale en-HK) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✓] Xcode - develop for iOS and macOS [✓] Chrome - develop for the web [✓] Android Studio (version 4.1) [✓] VS Code (version 1.55.2) [✓] Connected device (2 available)

Expected behavior Open the screen photo_view widget without error

My Code: class ProductImgViewer extends StatefulWidget { final List imgList;

@override ProductImgViewer(this.imgList, {Key key}) : super(key: key);

@override _ProductImgViewerState createState() => _ProductImgViewerState(); }

class _ProductImgViewerState extends State { int _current = 0; List imageSliders;

Widget build(BuildContext context) { return Scaffold( appBar: T2AppbarBack("Index"), body: Container( constraints: BoxConstraints.expand( height: MediaQuery.of(context).size.height, ), child: PhotoView( imageProvider: NetworkImage('https://picsum.photos/250?image=9'), )), ); } }

Version: Flutter: 2.0.3 photo_view: ^0.11.1 Android Version: 10

Thanks!!

sabetAI commented 3 years ago

I'm having a similar issue.

renancaraujo commented 3 years ago

Nice, in order to have enough information to work on this, would you follow the issue template?

A trace for the error would help as well.

kuyazee commented 3 years ago

This is also happening for me, there is no error being thrown even when the code is wrapped inside a try catch block

Here's my env

[✓] Flutter (Channel stable, 1.22.6, on macOS 11.2.3 20D91 darwin-x64, locale en-PH)

photo_view '0.10.3'

Here's my code

Scaffold(
  appBar: AppBar(),
  body: PhotoView(
    imageProvider: NetworkImage('any image url here'),
  ),
);
no-response[bot] commented 3 years ago

Since we got no answer for a while, I am automatically closing this issue for the sake of organization. If there is any news on that, feel free to retake the discussion.

no-response[bot] commented 3 years ago

Since we got no answer for a while, I am automatically closing this issue for the sake of organization. If there is any news on that, feel free to retake the discussion.

renancaraujo commented 3 years ago

Bad robot 😡

am1993421 commented 3 years ago

i'm also having this issue in my project. if load local image haven't this issue.but use NetworkImage load networkImage throw this exception Version: Flutter: 2.2.2 photo_view: ^0.11.1

thanks image

KarlGoddard96 commented 3 years ago

I'm also having this same issue. Maybe it's related to this: https://github.com/fireslime/photo_view/issues/341

This PR is closed, but I'm having the exact same issue. Doesn't matter what image provider I use. If I replace PhotoViewer() with any other widget it's works as intended

ken-code-wq commented 1 year ago

Any solutions ??