3

** Hi i want to use my asset image on screen while playing any song but im able to use oniline image but not asset image how to use asset image?**

      Uri.parse("live url"),
      tag: MediaItem(
        id: '${_nextMediaId++}',
        album: "Punjab1Radio",
        title: "Punjab1Radio Live",
        artUri: Uri.file('assets/logo.png'),
      ),
    ),```

1 Answers1

0

go to pubspec.yaml and remove the comment from asset dependency and chang the asset path to your asset path

  • 1
    Please expalain in detail with example. – Rahul Kushwaha Feb 20 '23 at 09:07
  • 1
    Parsing uri.file will take file path so assets should be added in pubspec yaml and if you want to import that file same path should be passed in pubspec yaml – Ashwani Bhardwaj Feb 25 '23 at 04:50
  • Yes @AshwaniBhardwaj I have written a solution for this https://stackoverflow.com/questions/75456939/how-to-show-artmusic-on-media-control-notification-from-assets-file-in-flutter – Rahul Kushwaha Mar 02 '23 at 04:45