I was trying to use this library in rendering my gifs. I am not using a controller, I'm just passing an ImageProvider without a controller.
I've attached my flutter doctor output and the complete error message.
I already had gifs rendering and working but I would need to evict them frequently because I have a variable number of gifs that render at once.
AppData/Local/Pub/Cache/hosted/pub.dev/gif-2.2.0/lib/gif.dart:348:51: Error: The method 'instantiateImageCodec' isn't defined for the class 'PaintingBinding'.
- 'PaintingBinding' is from 'package:flutter/src/painting/binding.dart' ('/C:/flutter/packages/flutter/lib/src/painting/binding.dart').
Try correcting the name to the name of an existing method, or defining a method named 'instantiateImageCodec'.
Codec codec = await PaintingBinding.instance!.instantiateImageCodec(bytes);
Flutter Doctor:
[ā] Flutter (Channel stable, 3.22.1, on Microsoft Windows [Version 10.0.22631.4037], locale en-US)
[ā] Windows Version (Installed version of Windows is version 10 or higher)
[ā] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[ā] Chrome - develop for the web
[ā] Android Studio (version 2022.3)
[ā] Android Studio (version 2023.1)
[ā] VS Code (version 1.92.2)
[ā] Connected device (3 available)
[ā] Network resources
I was trying to use this library in rendering my gifs. I am not using a controller, I'm just passing an ImageProvider without a controller. I've attached my flutter doctor output and the complete error message.
I already had gifs rendering and working but I would need to evict them frequently because I have a variable number of gifs that render at once.
I swapped it to:
Flutter Doctor: