setForeground static method

Future<void> setForeground(
  1. bool enabled,
  2. String title,
  3. String description,
  4. String icon,
  5. String activity,
)

Set foreground notification for android Accepts bool and String Returns void

Implementation

static Future<void> setForeground(bool enabled,
    String title,
    String description,
    String icon,
    String activity) async {
  final Map<String, dynamic> param = <String, dynamic>{
    'enableForeground': enabled,
    'foregroundTitle': title,
    'foregroundDescription': description,
    'foregroundImage': icon,
    'foregroundActivity': activity
  };
  await _channel.invokeMethod(METHOD_FOREGROUND_SERVICE, param);
}