Created
November 25, 2019 02:08
-
-
Save chunhunghan/5e822a6d2c440f0376415860887e5074 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Future<ui.Image> load(String asset) async { | |
| ByteData data = await rootBundle.load(asset); | |
| ui.Codec codec = await ui.instantiateImageCodec(data.buffer.asUint8List()); | |
| ui.FrameInfo fi = await codec.getNextFrame(); | |
| return fi.image; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment