QueryArtworkWidget Image blinking in flutter

Issue

I am building a music player in which I’m using on_audio_query package to get details of songs and QueryArtworkWidget and realtimeplayinginfos to display the image corresponding to the song. But while Iam playing the song, the image is blinking. Does anyone knows how to fix this?

ClipRRect(
        borderRadius: BorderRadius.circular(10),
        child: QueryArtworkWidget(
            nullArtworkWidget: Icon(
              Icons.music_note,
              color: white,
              size: 40,
            ),
            id: int.parse(realtimePlayingInfos.current!.audio.audio.metas.id!),
            type: ArtworkType.AUDIO))

Solution

Try to add a key

keepOldArtWork = true;

Answered By – Kaushik Chandru

Answer Checked By – Jay B. (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *