I would like to run a function with some random/dynamic delay. Future.delayed
can help in this but it took time as const
. I am unable to pass an expression or non const
value as time. Is there any way to make it parameterise or random? So with each call delay will be different.
Future.delayed(const Duration(milliseconds: needRandomNumberHere), () {
// code will be here
});