const oneSec = const Duration(seconds:1); new Timer.periodic(oneSec, (Timer t) => generateRandomNumber()); code example
Example: how to repeatedly call a function flutter
import 'dart:async';
main() {
var time = const Duration(//milliseconds: // // seconds: // // minutes: // ...);
Timer.periodic(time, (timer) => {// Function}
),
}