An advanced image provider provides caching and retrying for flutter app

Overview

Flutter Advanced Network Image Provider

Pub Package Pre Pub Package Build Status Coverage Status

An advanced image provider provides caching and retrying for flutter app. Now with zoomable widget and transition to image widget.

Getting Started

Installation

Add this to your pubspec.yaml (or create it):

dependencies:
  flutter_advanced_networkimage: any

Then run the flutter tooling:

flutter packages get

Example

// using image provider
Image(
  image: AdvancedNetworkImage(
    url,
    header: header,
    useDiskCache: true,
    cacheRule: CacheRule(maxAge: const Duration(days: 7)),
  ),
  fit: BoxFit.cover,
)
// work with precacheImage
precacheImage(
  AdvancedNetworkImage(
    url,
    header: header,
    useDiskCache: true,
    cacheRule: CacheRule(maxAge: const Duration(days: 7)),
  ),
  context,
);

// or svg provider (flutter_svg)
SvgPicture(
  AdvancedNetworkSvg(url, SvgPicture.svgByteDecoder, useDiskCache: true),
)
// get the disk cache folder size
int cacheSize = await DiskCache().cacheSize();
// clean the disk cache
bool isSucceed = await DiskCache().clear();
// using zooming widget & transitiontoimage widget
ZoomableWidget(
  minScale: 0.3,
  maxScale: 2.0,
  // default factor is 1.0, use 0.0 to disable boundary
  panLimit: 0.8,
  child: Container(
    child: TransitionToImage(
      image: AdvancedNetworkImage(url, timeoutDuration: Duration(minutes: 1)),
      // This is the default placeholder widget at loading status,
      // you can write your own widget with CustomPainter.
      placeholder: CircularProgressIndicator(),
      // This is default duration
      duration: Duration(milliseconds: 300),
    ),
  ),
)
// Reload feature included
TransitionToImage(
  image: AdvancedNetworkImage(url,
    loadedCallback: () {
      print('It works!');
    },
    loadFailedCallback: () {
      print('Oh, no!');
    },
    loadingProgress: (double progress) {
      print('Now Loading: $progress');
    },
  ),
  loadingWidgetBuilder: (_, double progress, __) => Text(progress.toString()),
  fit: BoxFit.contain,
  placeholder: const Icon(Icons.refresh),
  width: 400.0,
  height: 300.0,
  enableRefresh: true,
);
// Scale the widget size. (Origin point was fixed to screen's center)
ZoomableWidget(
  panLimit: 1.0,
  maxScale: 2.0,
  minScale: 0.5,
  singleFingerPan: true,
  multiFingersPan: false,
  enableRotate: true,
  child: Image(
    image: AssetImage('graphics/background.png'),
  ),
  zoomSteps: 3,
),

Details in example/ folder.

demo gif

If you have any problem or question, feel free to file issues.

Comments
  • Can not load image url

    Can not load image url

    My Image got this error:

    The following _Exception was thrown resolving an image codec:
    I/flutter ( 2022): Exception: Failed to load http://loliloli.pro:9000/images/chat/13ce919034328865b238f731e5bff0ba.
    I/flutter ( 2022): 
    I/flutter ( 2022): When the exception was thrown, this was the stack:
    I/flutter ( 2022): #0      AdvancedNetworkImage._loadAsync (package:flutter_advanced_networkimage/src/flutter_advanced_networkimage.dart:227:5)
    I/flutter ( 2022): <asynchronous suspension>
    I/flutter ( 2022): #1      AdvancedNetworkImage.load (package:flutter_advanced_networkimage/src/flutter_advanced_networkimage.dart:170:14)
    I/flutter ( 2022): #2      AdvancedNetworkImage.resolve.<anonymous closure>.<anonymous closure> (package:flutter_advanced_networkimage/src/flutter_advanced_networkimage.dart:153:37)
    I/flutter ( 2022): #3      ImageCache.putIfAbsent (package:flutter/src/painting/image_cache.dart:157:22)
    I/flutter ( 2022): #4      AdvancedNetworkImage.resolve.<anonymous closure> (package:flutter_advanced_networkimage/src/flutter_advanced_networkimage.dart:153:14)
    I/flutter ( 2022): #5      SynchronousFuture.then (package:flutter/src/foundation/synchronous_future.dart:38:29)
    I/flutter ( 2022): #6      AdvancedNetworkImage.resolve (package:flutter_advanced_networkimage/src/flutter_advanced_networkimage.dart:146:30)
    I/flutter ( 2022): #7      DecorationImagePainter.paint (package:flutter/src/painting/decoration_image.dart:239:55)
    I/flutter ( 2022): #8      _BoxDecorationPainter._paintBackgroundImage (package:flutter/src/painting/box_decoration.dart:414:19)
    I/flutter ( 2022): #9      _BoxDecorationPainter.paint (package:flutter/src/painting/box_decoration.dart:432:5)
    I/flutter ( 2022): #10     RenderDecoratedBox.paint (package:flutter/src/rendering/proxy_box.dart:1955:16)
    I/flutter ( 2022): #11     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2094:7)
    I/flutter ( 2022): #12     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
    I/flutter ( 2022): #13     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:122:15)
    I/flutter ( 2022): #14     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2094:7)
    I/flutter ( 2022): #15     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
    I/flutter ( 2022): #16     RenderShiftedBox.paint (package:flutter/src/rendering/shifted_box.dart:70:15)
    I/flutter ( 2022): #17     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2094:7)
    I/flutter ( 2022): #18     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
    I/flutter ( 2022): #19     RenderAnimatedOpacity.paint (package:flutter/src/rendering/proxy_box.dart:909:17)
    I/flutter ( 2022): #20     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2094:7)
    I/flutter ( 2022): #21     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
    I/flutter ( 2022): #22     _RenderStack&RenderBox&ContainerRenderObjectMixin&RenderBoxContainerDefaultsMixin.defaultPaint (package:flutter/src/rendering/box.dart:2273:15)
    I/flutter ( 2022): #23     RenderStack.paintStack (package:flutter/src/rendering/stack.dart:594:5)
    I/flutter ( 2022): #24     RenderStack.paint (package:flutter/src/rendering/stack.dart:602:7)
    I/flutter ( 2022): #25     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2094:7)
    I/flutter ( 2022): #26     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
    I/flutter ( 2022): #27     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:122:15)
    I/flutter ( 2022): #28     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2094:7)
    I/flutter ( 2022): #29     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
    I/flutter ( 2022): #30     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:122:15)
    I/flutter ( 2022): #31     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2094:7)
    I/flutter ( 2022): #32     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
    I/flutter ( 2022): #33     _RenderFlex&RenderBox&ContainerRenderObjectMixin&RenderBoxContainerDefaultsMixin.defaultPaint (package:flutter/src/rendering/box.dart:2273:15)
    I/flutter ( 2022): #34     RenderFlex.paint (package:flutter/src/rendering/flex.dart:931:7)
    I/flutter ( 2022): #35     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2094:7)
    I/flutter ( 2022): #36     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
    I/flutter ( 2022): #37     _RenderFlex&RenderBox&ContainerRenderObjectMixin&RenderBoxContainerDefaultsMixin.defaultPaint (package:flutter/src/rendering/box.dart:2273:15)
    I/flutter ( 2022): #38     RenderFlex.paint (package:flutter/src/rendering/flex.dart:931:7)
    I/flutter ( 2022): #39     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2094:7)
    I/flutter ( 2022): #40     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
    I/flutter ( 2022): #41     RenderShiftedBox.paint (package:flutter/src/rendering/shifted_box.dart:70:15)
    I/flutter ( 2022): #42     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2094:7)
    I/flutter ( 2022): #43     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
    I/flutter ( 2022): #44     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:122:15)
    I/flutter ( 2022): #45     RenderFractionalTranslation.paint (package:flutter/src/rendering/proxy_box.dart:2435:13)
    I/flutter ( 2022): #46     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2094:7)
    I/flutter ( 2022): #47     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
    I/flutter ( 2022): #48     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:122:15)
    I/flutter ( 2022): #49     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2094:7)
    I/flutter ( 2022): #50     PaintingContext._repaintCompositedChild (package:flutter/src/rendering/object.dart:128:11)
    I/flutter ( 2022): #51     PaintingContext.repaintCompositedChild (package:flutter/src/rendering/object.dart:96:5)
    I/flutter ( 2022): #52     PaintingContext._compositeChild (package:flutter/src/rendering/object.dart:190:7)
    I/flutter ( 2022): #53     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:171:7)
    I/flutter ( 2022): #54     _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:122:15)
    I/flutter ( 2022): #55     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2094:7)
    I/flutter ( 2022): #56     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
    I/flutter ( 2022): #57     RenderSliverMultiBoxAdaptor.paint (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:557:17)
    I/flutter ( 2022): #58     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2094:7)
    I/flutter ( 2022): #59     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
    I/flutter ( 2022): #60     RenderSliverPadding.paint (package:flutter/src/rendering/sliver_padding.dart:314:15)
    I/flutter ( 2022): #61     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2094:7)
    I/flutter ( 2022): #62     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:173:13)
    I/flutter ( 2022): #63     RenderViewportBase._paintContents (package:flutter/src/rendering/viewport.dart:524:17)
    I/flutter ( 2022): #64     PaintingContext.pushLayer (package:flutter/src/rendering/object.dart:370:12)
    I/flutter ( 2022): #65     PaintingContext.pushClipRect (package:flutter/src/rendering/object.dart:394:7)
    I/flutter ( 2022): #66     RenderViewportBase.paint (package:flutter/src/rendering/viewport.dart:515:15)
    I/flutter ( 2022): #67     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2094:7)
    I/flutter ( 2022): #68     PaintingContext._repaintCompositedChild (package:flutter/src/rendering/object.dart:128:11)
    I/flutter ( 2022): #69     PaintingContext.repaintCompositedChild (package:flutter/src/rendering/object.dart:96:5)
    I/flutter ( 2022): #70     PipelineOwner.flushPaint (package:flutter/src/rendering/object.dart:855:29)
    I/flutter ( 2022): #71     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:283:19)
    I/flutter ( 2022): #72     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:686:13)
    I/flutter ( 2022): #73     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:219:5)
    I/flutter ( 2022): #74     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
    I/flutter ( 2022): #75     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
    I/flutter ( 2022): #76     _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
    I/flutter ( 2022): #77     _invoke (dart:ui/hooks.dart:159:13)
    I/flutter ( 2022): #78     _drawFrame (dart:ui/hooks.dart:148:3)
    D/ViewRootImpl@d296bde[MainActivity]( 2022): ViewPostImeInputStage processPointer 1
    I/flutter ( 2022): 
    I/flutter ( 2022): Image provider:
    I/flutter ( 2022): AdvancedNetworkImage("http://loliloli.pro:9000/images/chat/13ce919034328865b238f731e5bff0ba",scale:
    I/flutter ( 2022): 1.0,header: null,useDiskCache: true,retryLimit: 5,retryDuration: 0:00:00.500000,retryDurationFactor:
    I/flutter ( 2022): 1.5,timeoutDuration: 0:00:05.000000)
    I/flutter ( 2022): Image provider:
    I/flutter ( 2022): AdvancedNetworkImage("http://loliloli.pro:9000/images/chat/13ce919034328865b238f731e5bff0ba",scale:
    I/flutter ( 2022): 1.0,header: null,useDiskCache: true,retryLimit: 5,retryDuration: 0:00:00.500000,retryDurationFactor:
    I/flutter ( 2022): 1.5,timeoutDuration: 0:00:05.000000)
    I/flutter ( 2022): ════════════════════════════════════════════
    

    http://loliloli.pro:9000/images/chat/13ce919034328865b238f731e5bff0ba this image is actually callable:

    bug 
    opened by jinfagang 12
  • Image Load Speed Much more Lower than NetworkImage

    Image Load Speed Much more Lower than NetworkImage

    I have some comparation, when a image is big, advanced_networkimage always failed to load image (actually it keep try accesing my image from cloud, but not continuely loading just somewhat corrupt loading and then start it over again failing at last).

    But NetworkImage can load image success eventually and much more faster than this lib.

    Such as this image

    http://loliloli.pro:9000/uploads/chat/groups/avatar/grpwjTe5WsQI3.jpg

    Since the image is big, then it will fail load , this is terrible, and it is slower than NetworkImage

    wontfix 
    opened by jinfagang 11
  • Pleae do not raise exception on fail

    Pleae do not raise exception on fail

    Please can you disable (or parametrize) the throwing exception when image loading fail? I set loadingWidget with starting image and I need to change it only if image is fully loaded. Now if I don't set fallbackAssetImage or fallbackImage, an exception was raised. I try to use fallbackAssetImage with same image, but we have a needless image loading from assets with a needless fading effect.

    question 
    opened by carmas123 11
  • Error: The method 'toDouble' was called on null.

    Error: The method 'toDouble' was called on null.

    I'm using the latest version with this dependency: flutter_advanced_networkimage: any

    Getting this error on some images I am trying to load.

    Error

    [VERBOSE-2:shell.cc(186)] Dart Error: Unhandled exception:
    NoSuchMethodError: The method 'toDouble' was called on null.
    Receiver: null
    Tried calling: toDouble()
    #0      Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:50:5)
    #1      int./ (dart:core/runtime/libintegers.dart:24:36)
    #2      _loadFromRemote.<anonymous closure>.<anonymous closure> (package:flutter_advanced_networkimage/src/flutter_advanced_networkimage.dart:270:39)
    #3      _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
    #4      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
    #5      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
    #6      _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:68:11)
    #7      _EventSinkWrapper.add (dart:async/stream_transformers.dart:15:11)
    #8      _HandlerEventSink.add (dart:async/stream_transformers.dart:238:13)
    #9      _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:120:24)
    #10  <…>
    
    

    Flutter Doctor

    [✓] Flutter (Channel beta, v1.1.8, on Mac OS X 10.14.2 18C54, locale en-US)
        • Flutter version 1.1.8 at /Users/nemory/Development/flutter
        • Framework revision 985ccb6d14 (4 weeks ago), 2019-01-08 13:45:55 -0800
        • Engine revision 7112b72cc2
        • Dart version 2.1.1 (build 2.1.1-dev.0.1 ec86471ccc)
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
        • Android SDK at /Users/nemory/Library/Android/sdk
        • Android NDK location not configured (optional; useful for native profiling support)
        • Platform android-28, build-tools 28.0.3
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
        • All Android licenses accepted.
    
    [✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 10.1, Build version 10B61
        • ios-deploy 1.9.4
        • CocoaPods version 1.5.3
    
    [✓] Android Studio (version 3.3)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin version 32.0.1
        • Dart plugin version 182.5124
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    
    [✓] VS Code (version 1.30.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 2.22.3
    
    [✓] Connected device (2 available)
        • Android SDK built for x86 • emulator-5554                        • android-x86 • Android 7.1.1 (API 25) (emulator)
        • iPhone XS Max             • 39AC65C7-4F9F-454F-B1B5-3376EE04BCBF • ios         • iOS 12.1 (simulator)
    
    • No issues found!
    
    bug 
    opened by oliverbytes 11
  • setState() called after dispose(): _TransitionToImageState#2d6c7(lifecycle state: defunct, not mounted, tickers: tracking 0 tickers)

    setState() called after dispose(): _TransitionToImageState#2d6c7(lifecycle state: defunct, not mounted, tickers: tracking 0 tickers)

    Hello, I'm having this error in console log. I'm using TransitionToImage in a ListView, when scrolling the listview, this error is printed in log. Here is full stacktrace:

    E/flutter ( 5765): setState() called after dispose(): _TransitionToImageState#8ea9f(lifecycle state: defunct, not mounted, tickers: tracking 0 tickers)
    E/flutter ( 5765): This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error can occur when code calls setState() from a timer or an animation callback. The preferred solution is to cancel the timer or stop listening to the animation in the dispose() callback. Another solution is to check the "mounted" property of this object before calling setState() to ensure the object is still in the tree.
    E/flutter ( 5765): This error might indicate a memory leak if setState() is being called because another object is retaining a reference to this State object after it has been removed from the tree. To avoid memory leaks, consider breaking the reference to this object during dispose().
    E/flutter ( 5765): 0      State.setState.<anonymous closure> (package:flutter/src/widgets/framework.dart:1103:9)
    E/flutter ( 5765): 1      State.setState (package:flutter/src/widgets/framework.dart:1129:6)
    E/flutter ( 5765): 2      _TransitionToImageState._updateImage.<anonymous closure> (package:flutter_advanced_networkimage/transition_to_image.dart:275:11)
    E/flutter ( 5765): 3      _RootZone.runUnary (dart:async/zone.dart:1379:54)
    E/flutter ( 5765): 4      _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
    E/flutter ( 5765): 5      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
    E/flutter ( 5765): 6      Future._propagateToListeners (dart:async/future_impl.dart:671:32)
    E/flutter ( 5765): 7      Future._complete (dart:async/future_impl.dart:476:7)
    E/flutter ( 5765): 8      _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
    E/flutter ( 5765): 9      _futurize.<anonymous closure> (dart:ui/painting.dart:3895:17)
    E/flutter ( 5765): 10     Image.toByteData.<anonymous closure>.<anonymous closure> (dart:ui/painting.dart:1531:17)
    
    bug 
    opened by skybur 10
  • Can't run or build on Flutter 1.7.4

    Can't run or build on Flutter 1.7.4

    Initializing gradle...
    Resolving dependencies...
    Running Gradle task 'assembleDebug'...
    registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
    registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
    registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
    registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
    registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
    
    Compiler message:
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/zoomable_image-1.3.1/lib/src/zoomable_image.dart:174:30: Error: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
     - 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/painting/image_stream.dart').
     - 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/painting/image_stream.dart').
    Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
        _imageStream.addListener(_handleImageLoaded);
                                 ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/zoomable_image-1.3.1/lib/src/zoomable_image.dart:186:33: Error: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
     - 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/painting/image_stream.dart').
     - 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/painting/image_stream.dart').
    Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
        _imageStream.removeListener(_handleImageLoaded);
                                    ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_advanced_networkimage-0.4.15/lib/src/flutter_advanced_networkimage.dart:149:29: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
     - 'StringBuffer' is from 'dart:core'.
     - 'Iterable' is from 'dart:core'.
     - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
    Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
          informationCollector: (StringBuffer information) {
                                ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_advanced_networkimage-0.4.15/lib/src/flutter_advanced_networksvg.dart:106:29: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
     - 'StringBuffer' is from 'dart:core'.
     - 'Iterable' is from 'dart:core'.
     - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
    Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
          informationCollector: (StringBuffer information) {
                                ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_advanced_networkimage-0.4.15/lib/src/transition_to_image.dart:254:33: Error: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
     - 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/painting/image_stream.dart').
     - 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/painting/image_stream.dart').
    Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
        _imageStream.removeListener(_updateImage);
                                    ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_advanced_networkimage-0.4.15/lib/src/transition_to_image.dart:303:49: Error: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
     - 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/painting/image_stream.dart').
     - 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/painting/image_stream.dart').
    Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
              return oldImageStream?.removeListener(_updateImage);
                                                    ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_advanced_networkimage-0.4.15/lib/src/transition_to_image.dart:325:38: Error: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
     - 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/painting/image_stream.dart').
     - 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/painting/image_stream.dart').
    Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
          oldImageStream?.removeListener(_updateImage);
                                         ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_advanced_networkimage-0.4.15/lib/src/transition_to_image.dart:326:46: Error: No named parameter with the name 'onError'.
          _imageStream.addListener(_updateImage, onError: _catchBadImage);
                                                 ^^^^^^^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_provider.dart:335:20: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
     - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
    Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
              context: 'while resolving a picture',
                       ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_provider.dart:337:33: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
     - 'StringBuffer' is from 'dart:core'.
     - 'Iterable' is from 'dart:core'.
     - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
    Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
              informationCollector: (StringBuffer information) {
                                    ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_provider.dart:432:31: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
     - 'StringBuffer' is from 'dart:core'.
     - 'Iterable' is from 'dart:core'.
     - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
    Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
            informationCollector: (StringBuffer information) {
                                  ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_provider.dart:495:31: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
     - 'StringBuffer' is from 'dart:core'.
     - 'Iterable' is from 'dart:core'.
     - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
    Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
            informationCollector: (StringBuffer information) {
                                  ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_provider.dart:559:31: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
     - 'StringBuffer' is from 'dart:core'.
     - 'Iterable' is from 'dart:core'.
     - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
    Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
            informationCollector: (StringBuffer information) {
                                  ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_stream.dart:256:16: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
     - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
    Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
          context: context,
                   ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/picture_stream.dart:301:18: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
     - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
    Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
            context: 'resolving a single-frame picture stream',
                     ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/svg.dart:158:18: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
     - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
    Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
            context: 'picture failed to precache',
                     ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/svg/parser_state.dart:399:35: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
     - 'StringBuffer' is from 'dart:core'.
     - 'Iterable' is from 'dart:core'.
     - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
    Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
                informationCollector: (StringBuffer buff) {
                                      ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/svg/parser_state.dart:408:22: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
     - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
    Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
                context: 'in _Element.clipPath',
                         ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/svg/parser_state.dart:798:31: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
     - 'StringBuffer' is from 'dart:core'.
     - 'Iterable' is from 'dart:core'.
     - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
    Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
            informationCollector: (StringBuffer buff) {
                                  ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/svg/parser_state.dart:809:18: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
     - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
    Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
            context: 'in parseSvgElement',
                     ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/utilities/errors.dart:8:32: Error: The argument type 'String' can't be assigned to the parameter type 'DiagnosticsNode'.
     - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
    Try changing the type of the parameter, or casting the argument to 'DiagnosticsNode'.
          context: 'in $methodName',
                                   ^
    file:///C:/SDKs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.12.4+1/lib/src/utilities/errors.dart:10:29: Error: The argument type 'Null Function(StringBuffer)' can't be assigned to the parameter type 'Iterable<DiagnosticsNode> Function()'.
     - 'StringBuffer' is from 'dart:core'.
     - 'Iterable' is from 'dart:core'.
     - 'DiagnosticsNode' is from 'package:flutter/src/foundation/diagnostics.dart' ('file:///C:/SDKs/flutter/packages/flutter/lib/src/foundation/diagnostics.dart').
    Try changing the type of the parameter, or casting the argument to 'Iterable<DiagnosticsNode> Function()'.
          informationCollector: (StringBuffer buff) {
                                ^
    Compiler failed on C:\Users\natsu\IdeaProjects\ProvaMerchent\lib\main.dart
    Finished with error: Gradle task assembleDebug failed with exit code 1```
    
    

    i know there is zoom_image plugin in the log, i will place issue on their side too, but for now can you check this plugin errors ? or at least what causing it ?

    opened by Saifallak 9
  • More breakages on master

    More breakages on master

    Compilation error is:

    file:///C:/Users/Kent/Repository/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_advanced_networkimage-0.5.0-alpha.3/lib/src/transition/transition_to_image.dart:254:33: Error: The argument type 'void Function(ImageInfo, bool)' can't be assigned to the parameter type 'ImageStreamListener'.
    
     - 'ImageInfo' is from 'package:flutter/src/painting/image_stream.dart' ('file:///C:/Users/Kent/Repository/flutter/packages/flutter/lib/src/painting/image_stream.dart').
     - 'ImageStreamListener' is from 'package:flutter/src/painting/image_stream.dart' ('file:///C:/Users/Kent/Repository/flutter/packages/flutter/lib/src/painting/image_stream.dart').
    Try changing the type of the parameter, or casting the argument to 'ImageStreamListener'.
        _imageStream.removeListener(_updateImage);
    
                                    ^
    
    bug 
    opened by kentcb 9
  • Exception: Failed to load Image

    Exception: Failed to load Image

    Can't catch error while image load failed.

    1. Wrong remote image url without http or https like MTU1MTU5MzE1OTc3NSM3NjgjanBn.jpg

    2. Bad image url returns 404 or others like http://example.com/test.png

    image

    my code as blow:

    return Container(
    	width: width,
    	height: height,
    	child: ClipRRect(
    		borderRadius: BorderRadius.circular(borderRadius),
    		child: TransitionToImage(
    			image: AdvancedNetworkImage(imgUrl,
    				loadedCallback: () {
    					print('It works!');
    				},
    				loadFailedCallback: () {
    					print('Oh, no!');
    				},
    				loadingProgress: (double progress) {
    					print('Now Loading: $progress');
    				},
    			),
    			fit: BoxFit.cover,
    		))),
    
    question need more details 
    opened by flute 9
  • loadingWidget in a ConstrainedBox, maxHeight problem

    loadingWidget in a ConstrainedBox, maxHeight problem

    I have a TransitionToImage, with a TransitionToImage as loadingWidgetwith a smaller cached image. I put all this into a ConstrainedBox with a given maxHeight. The problem is that the loadingWidget is using the maxHeight to set it's height, and not the height of the cached primaryImageSmall ( which is smaller ). The height is correct ( smaller ) once the primaryImage is finished loading. Am i doing something wrong here or is this a problem which could be fixed?

    Example code:

                          ConstrainedBox(
                              constraints: BoxConstraints(maxHeight: maxHeight),
                              child: TransitionToImage(
                                  AdvancedNetworkImage(
                                    primaryImage,
                                    useDiskCache: true,
                                  ),
                                  fit: BoxFit.contain,
                                  duration: Duration.zero,
                                  loadingWidget: TransitionToImage(
                                    AdvancedNetworkImage(
                                      primaryImageSmall,
                                      useDiskCache: true,
                                    ),
                                    fit: BoxFit.contain,
                                    duration: Duration.zero,
                                  )))
    
    

    Thanks for a great lib!

    bug 
    opened by erf 8
  • SVG support

    SVG support

    Hi, would it be possible to add SVG file support?

    I'm currently using this library to display SVG images over network, but it doesn't seem to cache the images, so I was hoping your awesome library to add SVG support.

    enhancement 
    opened by dasmikko 8
  • minScale and maxScale don't work

    minScale and maxScale don't work

    hi i'm try your plugin. I use this code:

    new Scaffold(
          body: new ZoomableWidget(
            minScale: 0.8,
            maxScale: 1.6,
            child: new Center(
              child: new Image(
                  image: new AdvancedNetworkImage(
                    url)),
            ),
          ),
    

    but the minScale and maxScale don't work

    opened by romaluca 8
  • .pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4

    .pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4

    Error output from Xcode build: ↳ ** BUILD FAILED **

    Xcode's output: ↳ ../../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:26: Error: Type 'DiagnosticableMixin' not found. class PictureStream with DiagnosticableMixin { ^^^^^^^^^^^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:44: Error: Type 'DiagnosticableMixin' not found. abstract class PictureStreamCompleter with DiagnosticableMixin { ^^^^^^^^^^^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:7: Error: The type 'DiagnosticableMixin' can't be mixed in. class PictureStream with DiagnosticableMixin { ^ ../../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:16: Error: The type 'DiagnosticableMixin' can't be mixed in. abstract class PictureStreamCompleter with DiagnosticableMixin { ^ ../../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:167:11: Error: Superclass has no method named 'debugFillProperties'. super.debugFillProperties(properties); ^^^^^^^^^^^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:171:30: Error: The method 'toStringShort' isn't defined for the class 'PictureStreamCompleter'. - 'PictureStreamCompleter' is from 'package:flutter_svg/src/picture_stream.dart' ('../../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart'). Try correcting the name to the name of an existing method, or defining a method named 'toStringShort'. ifPresent: _completer?.toStringShort(), ^^^^^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:266:11: Error: Superclass has no method named 'debugFillProperties'. super.debugFillProperties(description); ^^^^^^^^^^^^^^^^^^^

    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    

    Could not build the application for the simulator. Error launching application on iPhone Xʀ.

    opened by CompillerMaster 0
  • How to test

    How to test

    Hi, I'm writing widget tests but I end up with a Timer error from the loadFromRemote method: Pending timers: Timer (duration: 0:00:03.796875, periodic: false), created: #0 new _FakeTimer._ (package:quiver/testing/src/async/fake_async.dart:277:42) #6 loadFromRemote.run (package:flutter_advanced_networkimage/src/utils.dart:343:20) <asynchronous suspension> #7 loadFromRemote.run (package:flutter_advanced_networkimage/src/utils.dart) #8 loadFromRemote (package:flutter_advanced_networkimage/src/utils.dart:355:24) #9 AdvancedNetworkImage._loadAsync (package:flutter_advanced_networkimage/src/provider/flutter_advanced_networkimage.dart:195:35) #10 AdvancedNetworkImage.load (package:flutter_advanced_networkimage/src/provider/flutter_advanced_networkimage.dart:165:14) #11 AdvancedNetworkImage.resolve.<anonymous closure>.<anonymous closure> (package:flutter_advanced_networkimage/src/provider/flutter_advanced_networkimage.dart:149:17)

    I suppose the reason is it does not manage to load the image. How can you mock the image fetching ?

    opened by patchimou 0
  • Does not show refresh image

    Does not show refresh image

       Positioned(
              left: 0, right: 0,
              top: 0, bottom: 0,
              child: ClipRRect(
                               borderRadius: BorderRadius.circular(25),
    
    
              child: TransitionToImage(image: AdvancedNetworkImage(
              image, timeoutDuration: Duration(minutes: 1)
                 ),
                fit: BoxFit.cover,
                placeholder: const Icon(Icons.refresh, color: Colors.black,),
                width: 400.0,
                height: 300.0,
                        loadingWidgetBuilder: (_, double progress, __) => Center(child: CircularProgressIndicator(value: progress)),
                  enableRefresh: true,
    
    
    
                ),
              ),
            ),
    
    opened by jawad12345A 1
  • iOS Build Error on Flutter 1.20.0-1.0.pre

    iOS Build Error on Flutter 1.20.0-1.0.pre

    I upgraded to Flutter 1.20.0-1.0.pre this evening. Ever since that, I can't compile my app whoch uses the flutter_advanced_networkimage plugin.

    FLUTTER DOCTOR

    [✓] Flutter (Channel dev, 1.20.0-1.0.pre, on Mac OS X 10.15.5 19F101, locale
        en-GB)
     
    [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    [✓] Xcode - develop for iOS and macOS (Xcode 11.4)
    [✓] Android Studio (version 4.0)
    [!] IntelliJ IDEA Community Edition (version 2019.3.1)
        ✗ Flutter plugin not installed; this adds Flutter specific functionality.
        ✗ Dart plugin not installed; this adds Dart specific functionality.
    [✓] VS Code (version 1.42.1)
    [✓] Connected device (1 available)
    
    ! Doctor found issues in 1 category.
    

    LOGS

    Running Xcode build...
    Xcode build done.                                           26.2s
    Failed to build iOS app
    Could not build the application for the simulator.
    Error launching application on iPhone 11 Pro Max.
    Error output from Xcode build:
    ↳
    ** BUILD FAILED **
    
    
    Xcode's output:
    ↳
    /Applications/Flutter-SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:26: Error: Type 'DiagnosticableMixin' not found.
    class PictureStream with DiagnosticableMixin {
                             ^^^^^^^^^^^^^^^^^^^
    /Applications/Flutter-SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:44: Error: Type 'DiagnosticableMixin' not found.
    abstract class PictureStreamCompleter with DiagnosticableMixin {
                                               ^^^^^^^^^^^^^^^^^^^
    /Applications/Flutter-SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:7: Error: The type 'DiagnosticableMixin' can't be mixed in.
    class PictureStream with DiagnosticableMixin {
          ^
    /Applications/Flutter-SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:16: Error: The type 'DiagnosticableMixin' can't be mixed in.
    abstract class PictureStreamCompleter with DiagnosticableMixin {
                   ^
    /Applications/Flutter-SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:167:11: Error: Superclass has no method named 'debugFillProperties'.
        super.debugFillProperties(properties);
              ^^^^^^^^^^^^^^^^^^^
    /Applications/Flutter-SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:171:30: Error: The method 'toStringShort' isn't defined for the class 'PictureStreamCompleter'.
     - 'PictureStreamCompleter' is from 'package:flutter_svg/src/picture_stream.dart' ('/Applications/Flutter-SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'toStringShort'.
          ifPresent: _completer?.toStringShort(),
                                 ^^^^^^^^^^^^^
    /Applications/Flutter-SDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:266:11: Error: Superclass has no method named 'debugFillProperties'.
        super.debugFillProperties(description);
              ^^^^^^^^^^^^^^^^^^^
    
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner' from project 'Runner')
    
    opened by BasedMusa 2
  • Flutter stable 1.17.x incompatible - exception thrown

    Flutter stable 1.17.x incompatible - exception thrown

    Hello (again) and thank you for your work.

    Since upgrading to 1.17 stable I have experienced crashes when images failed to load.

    Investigated and found out that the reason is the new breaking changes to ImageProvider in 1.17.

    The bug can be reproduced with latest version 0.7.0 by using a TransitionToImage with a AdvancedNetworkImage as provider.

    If you for example use the plugin to display an image in a list with a builder and the widget is scrolled off and disposed and the image load fails - the result will be an exception.

    This error will propagate... return Future.error(StateError('Failed to load $url.')); ...and if TransitionToImage has been disposed

    @override
      void dispose() {
        _imageStream.removeListener(
            ImageStreamListener(_updateImage, onError: _catchBadImage));
        _controller.dispose();
        super.dispose();
      }
    

    No error handlers _catchBadImage

    will be registered and an unhandled error will propagate...

    So loading a list of images with flaky network (or failing urls) while scrolling will produce a lot of unhandled exceptions.

    I pinned down the solution to the problem to the new error handling in the 1.17.x version of ImageProvider where even the unhandled, parentless load error is handled by the ImageProvider (via a safe zone).

    I was preparing a pull request from my locally modified flutter_advanced_networkimage.dart when I discovered that the master branch has already been updated to the 1.17 new version of ImageProvider (the resolve() method removed).

    I have tried my app with the master branch version - and no exceptions are thrown

    I would very much appreciate a release of 0.8.0 since 0.7.0 is not compatible with the latest stable Flutter release 1.17.x (and it seems like you have already done the work).

    Please reach out if there is anything I can do to help.

    Thank you!

    opened by ninnepinne 3
  • feat: add scaleForDoubleTap to set the desire scale.

    feat: add scaleForDoubleTap to set the desire scale.

    add 'scaleForDoubleTap' parameter allows to set the scale for double tap action instead of using maxScale for double tap action.

    the scenario is that when I double tap, I want to zoom to 100% but in the same time, I also wish to be able to zoom more than 100%.(similar action as Google Photo) The original code didn't have the features.

    opened by chloe722 0
Owner
Dark Knight
Game Dev & Dragon Slayer
Dark Knight
An advanced story viewer for Flutter. Quite easy & Quite advanced

AdvStory ?? Quite simple & Quite advanced ?? Advanced Story viewer for Flutter. Supports image, video and custom stories. Full control over stories fo

Ertuğrul Yakın 21 Nov 18, 2022
Calculator provides simple and advanced mathematical functions in a beautifully designed app.

Hi there, I'm Behruz Hurramov Getting Started $ git clone https://github.com/ariscybertech/aris_calculator.git $ flutter packages get Run the applicat

Behruz Hurramov 3 Jul 7, 2022
Calculator provides simple and advanced mathematical functions in a beautifully designed app.

Adv Calculator See LICENSE A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get y

RAHUL SHARMA 3 Feb 21, 2022
Note provider - Note App using Provider state management, Sqflite and Localization for two language Arabic and English.

note_provider Sqflite with provider statemanagement Getting Started This project is a starting point for a Flutter application. A few resources to get

Mohanned Anwar 0 Jan 1, 2022
Dart package for Async Data Loading and Caching. Combine local (DB, cache) and network data simply and safely.

Stock is a dart package for loading data from both remote and local sources. It is inspired by the Store Kotlin library.

xmartlabs 59 Dec 24, 2022
Dusyeri provider task - Dusyeri provider task built using flutter

Düşyeri Provider Task https://github.com/alper-mf/dusyeri_provider_task/blob/7d1

null 1 May 9, 2022
A flutter library for loading images from network, resizing as per container size and caching while being memory sensitive.

Optimized Cached Image A flutter library for loading images from network, resizing and caching them for memory sensitivity. This resizes and stores th

Anvith Bhat 76 Dec 20, 2022
Stories like in Instagram, each story can include multiple images and videos. Package supports video, titles, preliminary caching.

flutter_instagram_stories A Flutter package for displaying stories just like Whatsapp & Instagram. Built-in groups (multiple stories with one icon), c

Alex Awaik 125 Dec 9, 2022
Flutter shareable package of object-oriented classes for local caching of user data in json

json_cache Json Cache is an object-oriented package to serve as a layer on top of local storage packages - packages that persist data locally on the u

Dartoos 10 Dec 19, 2022
A flutter search engine based on MediaWiki with caching.

Table of contents Project Description Working App Architecture BLoC/Cubit Pattern Caching using HiveDB App UI Project Setup To-Do How to get started w

Shashwat Joshi 42 Nov 7, 2022
Flutter simple image crop - A simple and easy to use flutter plugin to crop image on iOS and Android

Image Zoom and Cropping plugin for Flutter A simple and easy used flutter plugin to crop image on iOS and Android. Installation Add simple_image_crop

null 97 Dec 14, 2021
A Flutter plugin that provides assets abstraction management APIs without UI integration, you can get assets (image/video/audio) on Android, iOS and macOS.

photo_manager Photo/Assets management APIs for Flutter without UI integration, you can get assets (image/video/audio) from Android, iOS and macOS. 提供相

FlutterCandies 526 Jan 4, 2023
Dart library for decoding/encoding image formats, and image processing.

image Overview A Dart library providing the ability to load, save and manipulate images in a variety of different file formats. The library is written

Brendan Duncan 907 Dec 27, 2022
Album Image is based in photo_manager package and has the same concept as image_picker but with a more attractive interface to choose an image or video from the device gallery, whether it is Android or iOS

Album Image is based in photo_manager package and has the same concept as image_picker but with a more attractive interface to choose an image or vide

Phuong Vu 2 Oct 13, 2022
Form builder image picker - Form builder image picker for flutter

form_builder_image_picker Field for picking image(s) from Gallery or Camera for

Ferri Sutanto 0 Jan 28, 2022
Flutter Image add drag sort, Image add drag sort, support click event, delete, add, long press drag sort.

flutter_image_add_drag_sort Flutter Image add drag sort, Image add drag sort, support click event, delete, add, long press drag sort, support video fi

null 5 Jun 23, 2020
A list of Flutter beginners and advanced tutorials :wink:

Flutter Tutorials What is Flutter? Flutter is Google’s mobile app SDK for crafting high-quality native interfaces on iOS and Android in record time. F

Raunak Hajela 85 Nov 23, 2022
Advanced widgets, animations and more.

advanced_ui A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if t

null 2 Aug 11, 2022