import 'dart:ui'; import 'package:flutter/material.dart'; class ImaginiImageProvider extends ImageProvider { @override final String url; @override final double scale; @override final Map headers; ImaginiImageProvider(this.url, {this.scale = 1.0, this.headers}) : assert(url != null), assert(scale != null); NetworkImage _netImg; @override ImageStreamCompleter load(ImaginiImageProvider key, DecoderCallback decode) { return MultiFrameImageStreamCompleter( codec: _loadAsync(decode), scale: 1.0, debugLabel: fileId, informationCollector: () sync* { yield ErrorDescription('Path: $fileId'); }, ); } Future _loadAsync(DecoderCallback decode) async { _netImg._loadAsync(decode); } @override Future obtainKey(ImageConfiguration configuration) { } }