1

Hi I have a question regarding flutter I am building a live radio app using flutter for iOS and Android the application have 2 pages one for all shows details like timings name etc which I will get from api backend is nodejs and MySQL and one for playing audio I want live show image on the main screen and also upcoming 2 shows and pass away 2 shows at the bottom of live show image using api data which will changes time to time schedule details I am catching from api how to do that ? Is there ani plugin available or not

Jonas
  • 121,568
  • 97
  • 310
  • 388
Maaz Irfan
  • 21
  • 1

2 Answers2

1

The Timer.Periodic that Kozubi suggests can be used together with a StreamBuilder widget.

See the following answer.

A StreamBuilder is a good way to display changing data. The StreamBuilder listens to changes in the data and the output will be changed accordingly.

Dharman
  • 30,962
  • 25
  • 85
  • 135
BJW
  • 925
  • 5
  • 15
0

Use

Timer.periodic

Timer.periodic(Duration(seconds:10), (var timer){
//fetch your data and update state
}

https://api.dart.dev/stable/2.14.3/dart-async/Timer/Timer.periodic.html

Kozubi
  • 529
  • 3
  • 12