How To make interactive notification in Flutter

How To make interactive notification in Flutter



I am making a music player app in Flutter and I am not able to find anyway to make widget or something that is displayed in the notification tray and can play pause the music. Is it even possible to achieve this in flutter and if yes, the how can I do that? Thanks in advance.enter image description here





can you any code or image that make easy to understand what you want.
– Viren V Varasadiya
Aug 27 at 18:25





Like the musix match music controller.
– Ayush Singh
Aug 27 at 18:28





I want to make something like that for my flutter app.
– Ayush Singh
Aug 27 at 18:29




2 Answers
2



Because of the way android notifications work, you can only really customize them with android code (for now at least). So unfortunately, you're going to have to write some native code here.



The actual notification part is the exact same as directly with android in this case, so you can simply look that up. Here's a start though.



The other part to this is that you need to communicate between your flutter code and the native code which handles the notification. To do so, you need to use Platform Channels. Platform channels are things you register so that you can send data back and forth between java/kotlin/objc/swift and dart, in the form of events or 'method calls'. The docs do a better job than me of explaining how to use them.



This flutter dependency seems to do the work for me:-



https://pub.dartlang.org/packages/media_notification#-readme-tab-






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)