listen method
Implementation
@override
void listen(Function(PreferredDoubleTapAction) callback) {
methodChannel.setMethodCallHandler((call) async {
if (call.method == 'onPencilDoubleTap') {
switch (call.arguments?.toString()) {
case 'switchPrevious':
callback(PreferredDoubleTapAction.switchPrevious);
case 'showColorPalette':
callback(PreferredDoubleTapAction.showColorPalette);
case 'showInkAttributes':
callback(PreferredDoubleTapAction.showInkAttributes);
case 'ignore':
callback(PreferredDoubleTapAction.ignore);
case 'switchEraser':
callback(PreferredDoubleTapAction.switchEraser);
default:
callback(PreferredDoubleTapAction.none);
}
}
});
}