Class ScribePlugin

java.lang.Object
io.flutter.plugin.editing.ScribePlugin
All Implemented Interfaces:
ScribeChannel.ScribeMethodHandler

public class ScribePlugin extends Object implements ScribeChannel.ScribeMethodHandler
ScribePlugin is the implementation of all functionality needed for handwriting stylus text input.

The plugin handles requests for scribe sent by the ScribeChannel.

On API versions below 33, the plugin does nothing.

  • Constructor Details

  • Method Details

    • setView

      public void setView(@NonNull View view)
      Sets the View in which Scribe input is handled.

      Only one View can be set at any given time.

    • destroy

      public void destroy()
      Unregisters this ScribePlugin as the ScribeChannel.ScribeMethodHandler, for the ScribeChannel.

      Do not invoke any methods on a ScribePlugin after invoking this method.

    • isStylusHandwritingAvailable

      @RequiresApi(34) public boolean isStylusHandwritingAvailable()
      Returns true if the InputMethodManager supports Scribe stylus handwriting input.

      Call this or isFeatureAvailable before calling startStylusHandwriting to make sure it's available.

      Specified by:
      isStylusHandwritingAvailable in interface ScribeChannel.ScribeMethodHandler
    • startStylusHandwriting

      @RequiresApi(33) public void startStylusHandwriting()
      Starts stylus handwriting input.

      Typically isStylusHandwritingAvailable should be called first to determine whether this is supported by the IME.

      Specified by:
      startStylusHandwriting in interface ScribeChannel.ScribeMethodHandler
    • isFeatureAvailable

      public boolean isFeatureAvailable()
      A convenience method to check if Scribe is available.

      Differs from isStylusHandwritingAvailable in that it can be called from any API level without throwing an error.

      Call this or isStylusHandwritingAvailable before calling startStylusHandwriting to make sure it's available.

      Specified by:
      isFeatureAvailable in interface ScribeChannel.ScribeMethodHandler