This repository has been archived on 2023-11-13. You can view files and clone it, but cannot push or open issues or pull requests.
imagini/web_native/lib/widgets/imagini_image_provider.dart.tmp

41 lines
916 B
Plaintext
Raw Normal View History

2021-02-21 17:31:03 +00:00
import 'dart:ui';
import 'package:flutter/material.dart';
class ImaginiImageProvider extends ImageProvider<ImaginiImageProvider> {
@override
final String url;
@override
final double scale;
@override
final Map<String, String> 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<Codec> _loadAsync(DecoderCallback decode) async {
_netImg._loadAsync(decode);
}
@override
Future<ImaginiImageProvider> obtainKey(ImageConfiguration configuration) {
}
}