. whenComplete will fire a function either when the Future completes with an error or not, instead . then will fire a function after the Future completes without an error. This is the asynchronous equivalent of a “finally” block.
. whenComplete will fire a function either when the Future completes with an error or not, instead . then will fire a function after the Future completes without an error. This is the asynchronous equivalent of a “finally” block.