Created
June 24, 2020 13:00
-
-
Save Anirudhk07/795ede5a5509c5fcc7444437bad8f1e3 to your computer and use it in GitHub Desktop.
This file contains 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
if (snapshot.error == null) { | |
final String downloadUrl = | |
await snapshot.ref.getDownloadURL(); | |
await Firestore.instance | |
.collection("images") | |
.add({"url": downloadUrl, "name": imageName}); | |
setState(() { | |
isLoading = false; | |
}); | |
final snackBar = | |
SnackBar(content: Text('Yay! Success')); | |
Scaffold.of(context).showSnackBar(snackBar); | |
} else { | |
else { | |
print( | |
'Error from image repo ${snapshot.error.toString()}'); | |
throw ('This file is not an image'); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment