updateSystemWindow static method

Future<bool?> updateSystemWindow({
  1. SystemWindowGravity gravity = SystemWindowGravity.CENTER,
  2. int? width,
  3. int? height,
  4. String notificationTitle = "Title",
  5. String notificationBody = "Body",
  6. SystemWindowPrefMode prefMode = SystemWindowPrefMode.DEFAULT,
  7. bool isDisableClicks = false,
})

Update System Window

gravity Position of the window and default is SystemWindowGravity.CENTER width Width of the window and default is Constants.MATCH_PARENT height Height of the window and default is Constants.WRAP_CONTENT notificationTitle Notification title, applicable in case of bubble notificationBody Notification body, applicable in case of bubble prefMode Preference for the system window. Default is SystemWindowPrefMode.DEFAULT isDisableClicks Disables the clicks across the system window. Default is false. This is not applicable for bubbles.

Implementation

static Future<bool?> updateSystemWindow(
    {SystemWindowGravity gravity = SystemWindowGravity.CENTER,
    int? width,
    int? height,
    String notificationTitle = "Title",
    String notificationBody = "Body",
    SystemWindowPrefMode prefMode = SystemWindowPrefMode.DEFAULT,
    bool isDisableClicks = false}) async {
  final Map<String, dynamic> params = <String, dynamic>{
    'gravity': Commons.getWindowGravity(gravity),
    'width': width ?? Constants.MATCH_PARENT,
    'height': height ?? Constants.WRAP_CONTENT,
    'isDisableClicks': isDisableClicks
  };
  return await _channel
      .invokeMethod('updateSystemWindow', [notificationTitle, notificationBody, params, Commons.getSystemWindowPrefMode(prefMode)]);
}