title: Flutter - > UploadTask method OnComplete does not exists
body: <p>I see a lot of exercises that put onComplete but with my code this is the error</p>
  <p>The getter 'onComplete' isn't defined for the type 'UploadTask'.
  Try importing the library that defines 'onComplete', correcting the name to the name of an existing getter, or defining a getter or field named 'onComplete'</p>
  <p>WHY ??</p>
  <pre><code>void uploadImage() async {
      if (safeNeuralNetwork()) {
        //Subir imagen a firebase storage
        final Reference postImageRef =
            FirebaseStorage.instance.ref().child(&quot;Post Images&quot;);
        var timeKey = DateTime.now();
      
        print(sampleImage);
        UploadTask uploadTask =
            postImageRef.child(timeKey.toString() + &quot;.jpg&quot;).putFile(sampleImage);
        var imageUrl =
            await (await uploadTask.onComplete).ref.getDownloadURL();
        url = imageUrl.toString();
        print(url);
        // Guardar el post en la bbdd
        saveToDatabase(url);
        //Regresar en Home
        Navigator.pop(context);
      }
    }
  </code></pre>