Created
March 2, 2022 18:17
-
-
Save ali2236/84feffbfa915a2ce6d5952f8edf6dfbb 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<Size> resolveSize(ImageProvider image) async { | |
final resultController = StreamController<Size>(); | |
resolve(image, (info, _) { | |
final size = Size( | |
info.image.width.toDouble(), | |
info.image.height.toDouble(), | |
); | |
resultController.sink.add(size); | |
}); | |
late Size temp; | |
await for (var result in resultController.stream) { | |
resultController.close(); | |
temp = result; | |
break; | |
} | |
return temp; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment