Search code examples
androidflutteruilocalnotification

Flutter: Android: How can i make unremovable local notification toolbar with some action button on it as shown in screenshot


enter image description here

i am seeking for an easy implementation and if it is possible without any extra package then it would be more helpfull


Solution

  • You need to use Services on Android side (Official Documentation).

    In few words, foreground service starts in app background (it can be separate process, depends on your features and specifics). Service cannot be started and live on Android device silently to user (you starting service and you have few second to pin it to notification, otherwise the system kill it immediately), you need to create a notification and pin service to it. In service you can update your notification by some action (user interact with notification and you updating it) or by time (per minute update battery level status, for example).