run request for every 10 seconds flutter dart code example
Example: flutter run in background every second
Timer timer;
@override
void initState() {
super.initState();
timer = Timer.periodic(Duration(seconds: 15), (Timer t) => checkForNewSharedLists());
}
@override
void dispose() {
timer?.cancel();
super.dispose();
}