Flutter – Assertion failed: assetName != null is not true

Issue

After these codes create a screenshot, an image is created at the bottom. This is the code I implemented because I wanted to drag the created image after that.

However, an error occurs during execution and the code cannot be executed. Please help me to get my code to run fine.

Solution

Add the _bytes null-check on Positioned too:

if (bytes ! null)
  Positioned(...)

Answered By – enzo

Leave a Comment