isFeatureAvailable static method
A convenience method to check if the device currently supports Scribe stylus handwriting input.
Call this each time before calling startStylusHandwriting to make sure it's available.
This example shows using isFeatureAvailable to confirm that
startStylusHandwriting can be called.
link
if (!await Scribe.isFeatureAvailable()) {
// The device doesn't support stylus input right now, or maybe at all.
return;
}
// Scribe is supported, so start it.
Scribe.startStylusHandwriting();
See also:
- isStylusHandwritingAvailable, which is similar, but throws an error when called by an unsupported API level. It directly corresponds to the underlying Android API developer.android.com/reference/android/view/inputmethod/InputMethodManager#isStylusHandwritingAvailable().
- EditableText.stylusHandwritingEnabled, which controls whether Flutter's built-in text fields support handwriting input.
Implementation
static Future<bool> isFeatureAvailable() async {
final bool? result = await _channel.invokeMethod<bool?>('Scribe.isFeatureAvailable');
if (result == null) {
throw FlutterError('MethodChannel.invokeMethod unexpectedly returned null.');
}
return result;
}