addWatermark method

void addWatermark(
  1. BuildContext context,
  2. String watermark,
  3. {int rowCount = 3,
  4. int columnCount = 10,
  5. TextStyle textStyle}
)

Implementation

void addWatermark(BuildContext context, String watermark,
    {int rowCount = 3, int columnCount = 10, TextStyle textStyle}) async {
  if (_overlayEntry != null) {
    _overlayEntry.remove();
  }
  OverlayState overlayState = Overlay.of(context);
  _overlayEntry = OverlayEntry(
      builder: (context) => DisableScreenshotsWatarmark(
            rowCount: rowCount,
            columnCount: columnCount,
            text: watermark,
            textStyle: textStyle ??
                const TextStyle(
                    color: Color(0x08000000),
                    fontSize: 18,
                    decoration: TextDecoration.none),
          ));
  overlayState.insert(_overlayEntry);
  // return await _methodChannel.invokeMethod<void>("addWatermark", ['我是水印']);
}