A multifunctional Flutter image widget

Overview

OctoImage

pub package Build Status codecov

An image library for showing placeholders, error widgets and transform your image.

Recommended using with CachedNetworkImage version 2.2.0 or newer.

Getting Started

The OctoImage widget needs an ImageProvider to show the image. You can either supply the widget with a placeholder or progress indicator, an ImageBuilder and/or an error widget.

However, what OctoImage makes is the use of OctoSets. OctoSets are predefined combinations of placeholders, imagebuilders and error widgets.

So, either set the all the components yourself:

OctoImage(
  image: CachedNetworkImageProvider(
      'https://blurha.sh/assets/images/img1.jpg'),
  placeholderBuilder: OctoPlaceholder.blurHash(
    'LEHV6nWB2yk8pyo0adR*.7kCMdnj',
  ),
  errorBuilder: OctoError.icon(color: Colors.red),
  fit: BoxFit.cover,
);

Or use an OctoSet:

OctoImage.fromSet(
  fit: BoxFit.cover,
  image: CachedNetworkImageProvider(
    'https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/Macaca_nigra_self-portrait_large.jpg/1024px-Macaca_nigra_self-portrait_large.jpg',
  ),
  octoSet: OctoSet.circleAvatar(
    backgroundColor: Colors.red,
    text: Text("M"),
  ),
);

The CircleAvatar set shows a colored circle with the text inside during loading and when the image failed loading. When the image loads it animates to the image clipped as a circle.

ImageProviders

The recommended one is CachedNetworkImageProvider, as that supports the progress indicator, error and caching. It also works on Android, iOS, web and macOS, although without caching on the web. Make sure you use at least version 2.2.0.

The second best is NetworkImage, but any ImageProvider works in theory. However, for some ImageProviders (such as MemoryImage) it doesn't make sense to use OctoImage.

Placeholders and progress indicators

It would be best if you used either a placeholder or a progress indicator, but not both. Placeholders are only building once the image starts loading, but progress indicators are rebuilt every time new progress information is received. So if you don't use that progress indication, for example, with a static image, you should use a placeholder.

The most simple progress indicators use a CircularProgressIndicator.

OctoImage(
  image: image,
  progressIndicatorBuilder: (context) => 
    const CircularProgressIndicator(),
),
OctoImage(
  image: image,
  progressIndicatorBuilder: (context, progress) {
    double value;
    if (progress != null && progress.expectedTotalBytes != null) {
      value =
          progress.cumulativeBytesLoaded / progress.expectedTotalBytes;
    }
    return CircularProgressIndicator(value: value);
  },
),

However, because these are used so often, we prebuild these widgets for you. Just use OctoProgressIndicator.circularProgressIndicator()

OctoImage(
  image: image,
  progressIndicatorBuilder: OctoProgressIndicator.circularProgressIndicator(),
),

All included placeholders and progress indicators:

OctoPlaceholder Explanation
blurHash Shows a BlurHash image
circleAvatar Shows a colored circle with a text
circularProgressIndicator Shows a circularProgressIndicator with indeterminate progress.
frame Shows the Flutter Placeholder
OctoProgressIndicator Explanation
circularProgressIndicator Shows a simple CircularProgressIndicator

Error widgets

Error widgets are shown when the ImageProvider throws an error because the image failed loading. You can build a custom widget, or use the prebuild widgets:

OctoImage(
  image: image,
  errorBuilder: (context, error, stacktrace) =>
    const Icon(Icons.error),
);
OctoImage(
  image: image,
  errorBuilder: OctoError.icon(),
),

All included error widgets are:

OctoError Explanation
blurHash Shows a BlurHash placeholder with an error icon.
circleAvatar Shows a colored circle with a text
icon Shows an icon, default to Icons.error
placeholderWithErrorIcon Shows any placeholder with an icon op top.

Image builders

Image builders can be used to adapt the image before it is shown. For example the circleAvatar clips the image in a circle, but you could also add an overlay or anything else.

The builder function supplies a context and a child. The child is the image widget that is rendered.

An example that shows the image with 50% opacity:

OctoImage(
  image: image,
  imageBuilder: (context, child) => Opacity(
    opacity: 0.5,
    child: child,
  ),
),

A prebuild image transformer that clips the image as a circle:

OctoImage(
  image: image,
  imageBuilder: OctoImageTransformer.circleAvatar(),
),

All included image transformers are:

OctoImageTransformer Explanation
circleAvatar Clips the image in a circle

OctoSets

You get the most out of OctoImage when you use OctoSets. These sets contain a combination of a placeholder or progress indicator, an image builder and/or an error widget builder. It always contains at least a placeholder or progress indicator and an error widget.

You can use them with OctoImage.fromSet:

OctoImage.fromSet(
  image: image,
  octoSet: OctoSet.blurHash('LEHV6nWB2yk8pyo0adR*.7kCMdnj'),
),

All included OctoSets are:

OctoSet Explanation
blurHash Shows a blurhash as placeholder and error widget. When an error is thrown an icon is shown on top.
circleAvatar Shows a colored circle with text during load and error. Clips the image after successful load.
circularIndicatorAndIcon Shows a circularProgressIndicator with or without progress and an icon on error.

Contribute

If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our contribution guide and send us your pull request.

PR's with any new prebuild widgets or sets are highly appreciated.

Support

  • Feel free to open an issue. Make sure to use one of the templates!
  • Commercial support is available. Integration with your app or services, samples, feature request, etc. Email: [email protected]
  • Powered by: baseflow.com
Comments
  • [web] support for new CanvasKit

    [web] support for new CanvasKit

    πŸ› Bug Report

    Using OctoImage with the new CanvasKit Skia support seems to result in

    Another exception was thrown: Expected a value of type 'SkImage', but got one of type 'HtmlImage'
    

    exceptions. I'm still investigating, just asking if you already tried it.

    opened by deakjahn 17
  • gaplessPlayback broken: Bad state: Cannot clone a disposed image.

    gaplessPlayback broken: Bad state: Cannot clone a disposed image.

    πŸ”™ Regression

    @renefloor

    Minimal reproducible sample with OctoImage(checked iOS only)

    On the latest beta channel. What is more interesting on 1.22.0-12.1.pre everything was fine.

    import 'dart:async';
    
    import 'package:flutter/material.dart';
    import 'package:octo_image/octo_image.dart';
    
    void main() {
      runApp(MyApp());
    }
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          title: 'Flutter Demo',
          home: MyHomePage(),
        );
      }
    }
    
    class MyHomePage extends StatefulWidget {
      @override
      _MyHomePageState createState() => _MyHomePageState();
    }
    
    class _MyHomePageState extends State<MyHomePage> {
      int index = 0;
    
      @override
      void initState() {
        super.initState();
        Timer.periodic(
          Duration(seconds: 2),
          (timer) {
            setState(() {
              ++index;
            });
          },
        );
      }
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          body: OctoImage(
            image:
                NetworkImage('https://via.placeholder.com/300.png/09f/fff?index=$index'),
            imageBuilder: (_, image) => image,
            placeholderBuilder: (_) => Container(color: Colors.red),
            gaplessPlayback: true,
          ),
        );
      }
    }
    
    

    [βœ“] Flutter (Channel beta, 1.26.0-17.6.pre, on macOS 11.2.1 20D75 darwin-x64, locale en) β€’ Flutter version 1.26.0-17.6.pre at /Users/yauhen_sampir/fvm/versions/beta β€’ Framework revision a29104a69b (9 days ago), 2021-02-16 09:26:56 -0800 β€’ Engine revision 21fa8bb99e β€’ Dart version 2.12.0 (build 2.12.0-259.12.beta)

    [βœ“] Android toolchain - develop for Android devices (Android SDK version 29.0.3) β€’ Android SDK at /Users/yauhen_sampir/Library/Android/sdk β€’ Platform android-30, build-tools 29.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_242-release-1644-b3-6915495) β€’ All Android licenses accepted.

    [βœ“] Xcode - develop for iOS and macOS β€’ Xcode at /Applications/Xcode.app/Contents/Developer β€’ Xcode 12.4, Build version 12D4e β€’ CocoaPods version 1.10.1

    [βœ“] Chrome - develop for the web β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

    [βœ“] Android Studio (version 4.1) β€’ Android Studio at /Applications/Android Studio.app/Contents β€’ Flutter plugin can be installed from: πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter β€’ Dart plugin can be installed from: πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart β€’ Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

    [βœ“] VS Code (version 1.53.2) β€’ VS Code at /Applications/Visual Studio Code.app/Contents β€’ Flutter extension version 3.9.0

    Also can be reproduced using cached network image package https://github.com/Baseflow/flutter_cached_network_image/issues/513

    opened by fryette 13
  • reportError throws assertion: setState() called after dispose()

    reportError throws assertion: setState() called after dispose()

    RESOLVED: Fixed in Flutter master branch on 18th of May 2020

    getting below in logs with below example:

        return OctoImage(
          image: CachedNetworkImageProvider(url),
          placeholderBuilder: (context) =>
              context.watch<ThemeProvider>().isLightTheme
                  ? CircularProgressIndicator(
                      backgroundColor: Theme.of(context).primaryColor,
                      valueColor: const AlwaysStoppedAnimation(Colors.white),
                    )
                  : CircularProgressIndicator(
                      backgroundColor: Theme.of(context).primaryColor,
                    ),
          errorBuilder: (context, url, dynamic error) => _sizedContainer(
            Icon(
              Icons.error,
              color: Colors.red,
            ),
          ),
        );
    
    ════════ Exception caught by image resource service ════════════════════════════════════════════════
    The following assertion was thrown when reporting an error to an image listener:
    setState() called after dispose(): _ImageState#8fa88(lifecycle state: defunct, not mounted, stream: ImageStream#ebcf8(MultiFrameImageStreamCompleter#209a4, [960Γ—720] @ 1.0x, 1 listener), pixels: null, loadingProgress: null, frameNumber: null, wasSynchronouslyLoaded: false)
    
    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.
    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().
    
    When the exception was thrown, this was the stack: 
    #0      State.setState.<anonymous closure> (package:flutter/src/widgets/framework.dart:1197:9)
    #1      State.setState (package:flutter/src/widgets/framework.dart:1232:6)
    #2      _ImageState._getListener.<anonymous closure> (package:flutter/src/widgets/image.dart:1116:13)
    #3      ImageStreamCompleter.reportError (package:flutter/src/painting/image_stream.dart:504:24)
    #4      ImageStreamCompleter.setImage (package:flutter/src/painting/image_stream.dart:439:9)
    ...
    ════════════════════════════════════════════════════════════════════════════════════════════════════
    
    ════════ Exception caught by image resource service ════════════════════════════════════════════════
    setState() called after dispose(): _ImageState#b0bda(lifecycle state: defunct, not mounted, stream: ImageStream#6f11d(MultiFrameImageStreamCompleter#366d4, [1632Γ—1224] @ 1.0x, 1 listener), pixels: null, loadingProgress: null, frameNumber: null, wasSynchronouslyLoaded: false)
    ════════════════════════════════════════════════════════════════════════════════════════════════════
    
    bug 
    opened by kw2019ltd 7
  • [Regression] BoxFit cover for placeholder and error builders

    [Regression] BoxFit cover for placeholder and error builders

    πŸ”™ Regression

    Old (and correct) behavior

    When using Image.asset with BoxFit cover as placeholder or error builders, the fit is applied correctly. (On cached_network_image v2.2.0)

    Current behavior

    The specified BoxFit for the placeholder and error builders is not applied.

    Reproduction steps

    Simple example. In a real scenario the placeholder would be an Image.asset widget, but this is enough to see the regression.

    Container(
        color: Colors.red,
        child: OctoImage(
          image: NetworkImage('...'),
          placeholderBuilder: (context) {
            return Image.network(
              "https://blurha.sh/assets/images/img1.jpg",
              fit: BoxFit.cover,
            );
          },
          errorBuilder: (context, e, s) {
            return Image.network(
              "https://blurha.sh/assets/images/img1.jpg",
              fit: BoxFit.cover,
            );
          },
          fit: BoxFit.cover,
          height: 100,
          width: 100,
        ),
      ),
    
    

    image

    Configuration

    Version: 0.2.1

    opened by davidmartos96 5
  • Animate already loaded images when using gappless playback

    Animate already loaded images when using gappless playback

    :sparkles: What kind of change does this PR introduce? (Bug fix, feature, docs update...)

    Bug fix

    :arrow_heading_down: What is the current behavior?

    The image widget doesn't show the placeholder when the image is already loaded in memory.

    :new: What is the new behavior (if this is a feature change)?

    The image widget does show the placeholder when the image is already loaded, but the placeholder is the previous image and gapless playback is enabled.

    :boom: Does this PR introduce a breaking change?

    No

    :bug: Recommendations for testing

    Test in real life situations

    :memo: Links to relevant issues/docs

    Fixes baseflow/flutter_cached_network_image#625

    :thinking: Checklist before submitting

    • [X] All projects build
    • [X] Follows style guide lines
    • [X] Relevant documentation was updated
    • [X] Rebased onto current develop
    opened by renefloor 3
  • Size is infinite although width and or height are set.

    Size is infinite although width and or height are set.

    πŸ› Bug Report

    Size is infinite although width and or height are set.

    Expected behavior

    I expect the widget to adhere to the width and height that are set.

    Reproduction steps

    Leading widget consumes entire tile width. Please use a sized widget.
    'package:flutter/src/material/list_tile.dart':
    Failed assertion: line 1353 pos 7: 'tileWidth != leadingSize.width'
    

    I have the image inside a ListTile like this:

    ListTile(
                          contentPadding: EdgeInsets.only(
                              left: 4.0, right: 8.0, top: 4.0, bottom: 4.0),
                          leading: CachedNetworkImage(
                            imageUrl:
                                "https://www.themealdb.com/images/ingredients/" +
                                    Uri.encodeComponent(item.title) +
                                    ".png",
                            placeholder: (context, url) =>
                                CircularProgressIndicator(),
                            errorWidget: (context, url, error) => Icon(Icons.error),
                            fit: BoxFit.fill,
                            width: 32,
                            height: 32,
                          ),
                          title: Text(item.title, style: Styles.listText),
                          trailing: Icon(Icons.add),
                          onTap: () {
                            Navigator.of(context).pop();
                          }),
    

    From: https://github.com/Baseflow/flutter_cached_network_image/issues/273#issuecomment-635806477

    Configuration

    Version: 0.2.0

    Platform:

    • [X] :iphone: iOS
    • [X] :robot: Android
    good first issue 
    opened by renefloor 3
  • Migrate to null safety

    Migrate to null safety

    :sparkles: What kind of change does this PR introduce? (Bug fix, feature, docs update...)

    Feature

    :arrow_heading_down: What is the current behavior?

    Library is not migrate to NNBD

    :new: What is the new behavior (if this is a feature change)?

    Library is migrated to NNBD

    :boom: Does this PR introduce a breaking change?

    Yes

    :bug: Recommendations for testing

    All tests still run

    :memo: Links to relevant issues/docs

    Waiting for PR https://github.com/brianegan/transparent_image/pull/8 to be merged Waiting for PR https://github.com/fluttercommunity/flutter_blurhash/pull/25 to be published

    :thinking: Checklist before submitting

    • [X] All projects build
    • [X] Follows style guide lines
    • [ ] Relevant documentation was updated
    • [X] Rebased onto current develop
    opened by renefloor 2
  • Update links for pub.dev

    Update links for pub.dev

    :sparkles: What kind of change does this PR introduce? (Bug fix, feature, docs update...)

    With this PR, the right section on pub.dev will show the View/report issues link to GitHub again, like here (the show-logic was recently changed).

    :arrow_heading_down: What is the current behavior?

    It shows a Homepage link

    :new: What is the new behavior (if this is a feature change)?

    It shows links to Repository (GitHub) and View/report issues

    :boom: Does this PR introduce a breaking change?

    No.

    :bug: Recommendations for testing

    :memo: Links to relevant issues/docs

    :thinking: Checklist before submitting

    • [ ] All projects build
    • [x] Follows style guide lines
    • [x] Relevant documentation was updated
    • [x] Rebased onto current develop
    opened by nohli 1
  • chore: upgrade flutter_blurhash version

    chore: upgrade flutter_blurhash version

    :sparkles: What kind of change does this PR introduce? (Bug fix, feature, docs update...)

    Upgrade flutter_blurshash version

    :new: What is the new behavior (if this is a feature change)?

    no change

    :boom: Does this PR introduce a breaking change?

    no

    :bug: Recommendations for testing

    :memo: Links to relevant issues/docs

    :thinking: Checklist before submitting

    • [ ] All projects build
    • [ ] Follows style guide lines
    • [ ] Relevant documentation was updated
    • [ ] Rebased onto current develop
    opened by daadu 1
  • move to flutter lints

    move to flutter lints

    :sparkles: What kind of change does this PR introduce? (Bug fix, feature, docs update...)

    bug fix

    :arrow_heading_down: What is the current behavior?

    Currently we are using pedantic, which is discontinued

    :new: What is the new behavior (if this is a feature change)?

    Use flutter lints

    :boom: Does this PR introduce a breaking change?

    No

    :bug: Recommendations for testing

    :memo: Links to relevant issues/docs

    :thinking: Checklist before submitting

    • [x] All projects build
    • [x] Follows style guide lines
    • [x] Relevant documentation was updated
    • [x] Rebased onto current develop
    opened by renefloor 1
  • Bugfix/rebuild image widget

    Bugfix/rebuild image widget

    :sparkles: What kind of change does this PR introduce? (Bug fix, feature, docs update...)

    Bugfix for #17

    :arrow_heading_down: What is the current behavior?

    Currently OctoWidget is using the result of the frameBuilder of the Image widget as placeholder for the new image if you use gaplessPlayback. We should not keep that widget and reuse it as it might be disposed already. We should rebuild the widget.

    :new: What is the new behavior (if this is a feature change)?

    The new behaviour rebuilds the widget when using gaplessPlayback. To make sure it does use the old widget properties by storing them in the ImageHandler. The ImageHandler can thus rebuild the widget based on the old properties.

    :boom: Does this PR introduce a breaking change?

    Behaviour changes, but more like you would expect it to happen.

    :bug: Recommendations for testing

    I changed the example in #17 a bit with a constructed ImageBuilder function. This way the old index is visible while it fades to the new widget with the new index:

    import 'dart:async';
    
    import 'package:flutter/material.dart';
    import 'package:octo_image/octo_image.dart';
    
    void main() {
      runApp(MyApp());
    }
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          title: 'Flutter Demo',
          home: MyHomePage(),
        );
      }
    }
    
    class MyHomePage extends StatefulWidget {
      @override
      _MyHomePageState createState() => _MyHomePageState();
    }
    
    class _MyHomePageState extends State<MyHomePage> {
      int index = 0;
    
      @override
      void initState() {
        super.initState();
        Timer.periodic(
          Duration(seconds: 10),
          (timer) {
            setState(() {
              ++index;
            });
          },
        );
      }
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          body: OctoImage(
            fadeInDuration: Duration(seconds: 4),
            fadeOutDuration: Duration(seconds: 4),
            image: NetworkImage(
                'https://via.placeholder.com/300.png/09f/fff?index=$index'),
            imageBuilder: ImageBuilderFactory(index).build,
            placeholderBuilder: (_) => Container(color: Colors.red),
            gaplessPlayback: true,
          ),
        );
      }
    }
    
    class ImageBuilderFactory {
      final int index;
    
      ImageBuilderFactory(this.index);
    
      Widget build(BuildContext context, Widget child) {
        return Stack(
          alignment: Alignment.bottomCenter,
          children: [
            child,
            Text(index.toString()),
          ],
        );
      }
    }
    

    :memo: Links to relevant issues/docs

    Fixes #17 Should fix https://github.com/Baseflow/flutter_cached_network_image/issues/513 as well.

    :thinking: Checklist before submitting

    • [X] All projects build
    • [X] Follows style guide lines
    • [X] Relevant documentation was updated
    • [X] Rebased onto current develop
    opened by renefloor 1
  • Use AlignmentGeometry in constructor

    Use AlignmentGeometry in constructor

    :sparkles: What kind of change does this PR introduce? (Bug fix, feature, docs update...)

    Bug fix

    :arrow_heading_down: What is the current behavior?

    defined: final AlignmentGeometry alignment In constructor: Alignment? alignment,

    Event in the comment of alignment field, it said can be AlignmentDirectional but the constructor not allowed.

    :boom: Does this PR introduce a breaking change?

    No

    :bug: Recommendations for testing

    :memo: Links to relevant issues/docs

    :thinking: Checklist before submitting

    • [ ] All projects build
    • [ ] Follows style guide lines
    • [ ] Relevant documentation was updated
    • [ ] Rebased onto current develop
    opened by narumi147 0
  • Memory leak and crash with gapless

    Memory leak and crash with gapless

    I got an issue with OOM on a very low device with random crashes. After investigation, I figure out that the problem with ImageHandler was reassigned.

    Why did it happen? Because in _OctoImageState in didUpdateWidget method each time reassign previous handler and saves current as well because of placeholder + progressBuilder properties. So in time, you have a situation where during the build method code executes build for all prev handlers and request all the images in the hierarchy(for 12 images on screen after 1 min with 10-sec delay of changing URL have 60 sec/10 delay =6 requests for each image + decoding job which cause the crash).

    Fix proposal Instead of each time reassigning handler need to create a new handler for the previous state without a placeholder and progress from the current handle or provide a way how to clear prev handler

    instead of _previousHandler = _imageHandler; Need to recreate ImageHandler without placeholder from current ImageHandler

    _previousHandler = ImageHandler(
              image: oldWidget.image,
              imageBuilder: oldWidget.imageBuilder,
              placeholderBuilder: oldWidget.placeholderBuilder,
              progressIndicatorBuilder: oldWidget.progressIndicatorBuilder,
              errorBuilder: oldWidget.errorBuilder,
              placeholderFadeInDuration: oldWidget.placeholderFadeInDuration,
              fadeOutDuration: oldWidget.fadeOutDuration,
              fadeOutCurve: oldWidget.fadeOutCurve,
              fadeInDuration: oldWidget.fadeInDuration,
              fadeInCurve: oldWidget.fadeInCurve,
              fit: oldWidget.fit,
              width: oldWidget.width,
              height: oldWidget.height,
              alignment: oldWidget.alignment,
              repeat: oldWidget.repeat,
              color: oldWidget.color,
              colorBlendMode: oldWidget.colorBlendMode,
              matchTextDirection: oldWidget.matchTextDirection,
              filterQuality: oldWidget.filterQuality,
            );
    

    This issue is not related to Flutter 3.x. It's reproducible on 2.10.3 and 3.x.

    I also saw a couple of old issues with CachableImage on flutter GitHub, and I think that can be a root cause of crashes

    opened by fryette 2
  • Image decode complete notification

    Image decode complete notification

    πŸš€ Feature Requests

    Due to some needs of the project, we need to monitor the loading time of pictures, not only downloading, including decoding. That is, we need to know how many times to display a set of pictures, from the begin loading to render complete (rendering monitoring may be difficult, then use the decoding completion time is ok) .

    I think the property _isLoaded of ImageHandler is very useful, how to expose it. Actually, we want to use(or get) it in CachedNetworkImage

    Contextualize the feature

    Describe the feature

    Platforms affected (mark all that apply)

    • [ ] :iphone: iOS
    • [ ] :robot: Android
    opened by weiminghuaa 0
  • Inkwell effect on image

    Inkwell effect on image

    I'm sure you are aware of the various problems with inkwell effects on images. What's your preferred solution with respect to Octoimage? Maybe could include an option to include the Image as Ink.Image rather than the normal Image(....)?

    Or, as I mentioned in my separate request, provide the imageprovider in the imagebuilder constructor and allow the user to do this him/her-self?

    opened by rooscarljohan 0
  • extend OctoImage-->imageBuilder to also include the imageprovider

    extend OctoImage-->imageBuilder to also include the imageprovider

    Great package!

    Sometimes it is also valuable to obtain the imageprovider in the imageBuilder constructor.

    Currently it looks like this: typedef OctoImageBuilder = Widget Function(BuildContext context, Widget child);

    Hence I'd like it changed to typedef OctoImageBuilder = Widget Function(BuildContext context, Widget child, Imageprovider image);

    Had a look at CachedNetworkImage, and did a workaround:

      ImageProvider imageProvider =...
    
       return OctoImage(
        image: imageProvider,
         ...
        imageBuilder: (context, _) => here i'm using the imageProvider
      );
    

    but would be more slick to have the imageprovider directly in the imageBuilder's constructor

    enhancement 
    opened by rooscarljohan 3
Owner
Baseflow
We provide software, skills and knowledge and with this we want to make a contribution to the world. We love to make innovation happen.
Baseflow
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
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
Flutter Package used to 'edit' basics aspects [Brightness, Contrast, Saturation, etc...] from a widget or image.

on_image_matrix on_image_matrix is a Flutter Package used to 'edit' basics aspects [Brightness, Contrast, Saturation, etc...] from a widget or image.

Lucas Josino 6 Oct 23, 2022
Convert Widget To Image in Flutter

Convert Widget To Image You can transform all of your widgets into images in Flu

Behruz Hurramov 1 Dec 28, 2022
A widget that shows an image which can be scaled and dragged using gestures.

[DISCONTINUED] - 24.05.2021 While this widget was useful in the early days of Flutter, the Flutter team introduced an own way to zoom and pan, see Int

EPNW 15 May 3, 2022
Gif image widget help to controll gif progress,speed,repeat frames

We should know that in order to achieve Gif in flutter, we can use Image, but we have no way to manipulate Gif, for example: change its speed, control it has been playing in a frame, in which frame range loop. These problems can be solved by this widget,it also help you contain gif cache,avoid load frame every time.

Samuel Annin Yeboah 13 Dec 9, 2022
Widget to count the amount of nested widget tree, useful in the dynamic construction of the interface when it is important to know the depth of widget.

widget_tree_depth_counter Widget Tree Depth Counter WidgetTreeDepthCounter is a simple widget to count the amount of nested widget tree, useful in the

Riccardo Cucia 4 Aug 1, 2022
MindInventory 15 Sep 5, 2022
Flutter profile ui - Round Image Profile UI For Flutter

round_image_page A new Flutter project.

Mahfozur Rahman Asif 2 Oct 21, 2022
Flutter plugin for selecting images from the Android and iOS image library, taking new pictures with the camera, and edit them before using such as rotation, cropping, adding sticker/text/filters.

advance_image_picker Flutter plugin for selecting multiple images from the Android and iOS image library, taking new pictures with the camera, and edi

Weta Vietnam 91 Dec 19, 2022
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
A flutter plugin to crop image on iOS and Android.

Image Cropping plugin for Flutter A flutter plugin to crop image on iOS and Android. The plugin comes with a Crop widget. The widget renders only imag

Volodymyr Lykhonis 292 Dec 27, 2022
A showcase app for displaying image lists, developed on Flutter.

flutter_showcase_app Pixabay: A Flutter demo application. A showcase app for displaying image lists, developed on Flutter. Uses BLOC pattern, SQFLite

Muhammad Umair Adil 26 Nov 25, 2022
A chat app built on Flutter with firebase authentication and image sharing capability.

Flutter Chat App A one-to-one chat app built on Flutter with firebase authentication and image sharing capability. For help getting started with Flutt

Rohan Taneja 1.1k Dec 27, 2022
Flutter image filters plugin

filter A flutter plugin project to apply images filters to file image natively and efficiently. WARNING!! Implemented in Android PR are welcomed for I

Patrick waweru 7 May 28, 2021
A flutter package uses native implementations to resize an image

fast_image_resizer This package uses native implementations to resize an image.

Soeren Schoenbrod 0 Dec 20, 2021