updateSystemWindow static method

Future<bool?> updateSystemWindow({
  1. required SystemWindowHeader header,
  2. SystemWindowBody? body,
  3. SystemWindowFooter? footer,
  4. SystemWindowMargin? margin,
  5. SystemWindowGravity gravity = SystemWindowGravity.CENTER,
  6. int? width,
  7. int? height,
  8. String notificationTitle = "Title",
  9. String notificationBody = "Body",
  10. SystemWindowPrefMode prefMode = SystemWindowPrefMode.DEFAULT,
})

Implementation

static Future<bool?> updateSystemWindow(
    {required SystemWindowHeader header,
    SystemWindowBody? body,
    SystemWindowFooter? footer,
    SystemWindowMargin? margin,
    SystemWindowGravity gravity = SystemWindowGravity.CENTER,
    int? width,
    int? height,
    String notificationTitle = "Title",
    String notificationBody = "Body",
    SystemWindowPrefMode prefMode = SystemWindowPrefMode.DEFAULT}) async {
  assert(header != null);
  final Map<String, dynamic> params = <String, dynamic>{
    'header': header.getMap(),
    'body': body?.getMap(),
    'footer': footer?.getMap(),
    'margin': margin?.getMap(),
    'gravity': Commons.getWindowGravity(gravity),
    'width': width ?? Constants.MATCH_PARENT,
    'height': height ?? Constants.WRAP_CONTENT
  };
  return await _channel.invokeMethod('updateSystemWindow', [notificationTitle, notificationBody, params, Commons.getSystemWindowPrefMode(prefMode)]);
}