setBrightness method

  1. @override
void setBrightness(
  1. Brightness? brightness
)
override

change webview theme.

available only: macOS (Brightness.dark only 10.14+)

Implementation

@override
void setBrightness(Brightness? brightness) {
  /// -1 : system default
  /// 0 : dark
  /// 1 : light
  if (!Platform.isMacOS) {
    return;
  }
  channel.invokeMethod("setBrightness", {
    "viewId": viewId,
    "brightness": brightness?.index ?? -1,
  });
}