I have a sample code for a radiostream player. The code provides for an icon to represent its state (paused or playing). I would like to show an image instead of the icon.
Being a newby/noob with flutter im stuck. Can sonebody push me in the right direction?
Here is the current code:
...........
default:
return Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
IconButton(
onPressed: () async {
print("button press data: " +
snapshot.data.toString());
await _flutterRadioPlayer.playOrPause();
},
icon: snapshot.data ==
FlutterRadioPlayer
.flutter_radio_playing
? Icon(Icons.pause)
: Icon(Icons.play_arrow))
]);
break;
}
...............
So in short, i want to use an image, "pause.png" for Icons.pause and "play.png" for Icons.play_arrow.